[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EWOULDBLOCK and EINPROGRESS in process.c
From: |
Eli Zaretskii |
Subject: |
Re: EWOULDBLOCK and EINPROGRESS in process.c |
Date: |
Wed, 25 Mar 2015 20:13:04 +0200 |
> From: Andreas Schwab <address@hidden>
> Cc: address@hidden
> Date: Tue, 24 Mar 2015 22:25:11 +0100
>
> Eli Zaretskii <address@hidden> writes:
>
> > process.c has this fragment after it calls 'connect':
> >
> > #ifdef NON_BLOCKING_CONNECT
> > #ifdef EINPROGRESS
> > if (is_non_blocking_client && xerrno == EINPROGRESS)
> > break;
> > #else <<<<<<<<<<<<<<<<<<<<<<<<<<<<
> > #ifdef EWOULDBLOCK
> > if (is_non_blocking_client && xerrno == EWOULDBLOCK)
> > break;
> > #endif
> > #endif
> > #endif
> >
> > Can someone tell why we need that "#else" there? Suppose there's a
> > platform that has both values defined, but only returns EWOULDBLOCK
> > when a non-blocking 'connect' is called -- that platform will fall
> > through the cracks here.
>
> POSIX only defines EINPROGRESS for this situation, so such a platform
> would be buggy.
>
> > Is there any problem to replace #else with #endif here?
>
> I don't think it would make any difference in practice.
Got it, thanks.