emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EWOULDBLOCK and EINPROGRESS in process.c


From: Andreas Schwab
Subject: Re: EWOULDBLOCK and EINPROGRESS in process.c
Date: Tue, 24 Mar 2015 22:25:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.91 (gnu/linux)

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.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]