First of all, I'd like to thank you for making and maintaining reproc.
I'm just starting out with the library, and while learning it I've noticed a strange line inside reproc_read():
return r == 0 ? -REPROC_EWOULDBLOCK : r;
It is understood that reproc_read() returns the number of bytes read upon success, and a negative value on failure. However, upon encountering a "would block" situation, it seems the result would be positive instead of negative, e.g. -(-EWOULDBLOCK)) on POSIX, and the caller won't be able to detect this error.
Hi Daan,
First of all, I'd like to thank you for making and maintaining reproc.
I'm just starting out with the library, and while learning it I've noticed a strange line inside
reproc_read()
:It is understood that
reproc_read()
returns the number of bytes read upon success, and a negative value on failure. However, upon encountering a "would block" situation, it seems the result would be positive instead of negative, e.g.-(-EWOULDBLOCK))
on POSIX, and the caller won't be able to detect this error.Am I missing something? Thanks.