RFR 8203369 : Check for both EAGAIN and EWOULDBLOCK error codes

Ivan Gerasimov ivan.gerasimov at oracle.com
Fri May 25 06:34:37 UTC 2018


On 5/24/18 10:25 PM, Weijun Wang wrote:
> https://stackoverflow.com/questions/27509061/macro-to-avoid-duplicate-case-value
>
> Someone has already used them in a switch expression...
Interesting!

I like the very first solution:
  #if EAGAIN != EWOULDBLOCK
       case EAGAIN:
  #endif
       case EWOULDBLOCK:

It is descriptive enough and compiles optimally.

Fortunately, we don't have to care about it now, as the fix only adds 
checks of errno right after calls to system functions and does not store 
the errno value anywhere to analyze it later.

-- 
With kind regards,
Ivan Gerasimov



More information about the net-dev mailing list