Changed O_NDELAY to O_NONBLOCK. On some versions of Unix, read
return 0 when O_NDELAY is set and there is nothing to read. We want the O_NONBLOCK behavior where read returns -1 and sets errno to EAGAIN when there is nothing to read.
This commit is contained in:
parent
613413fb50
commit
9c9db6958f
|
@ -561,10 +561,10 @@ CArchNetworkBSD::setBlockingOnSocket(int fd, bool blocking)
|
|||
throwError(errno);
|
||||
}
|
||||
if (blocking) {
|
||||
mode &= ~O_NDELAY;
|
||||
mode &= ~O_NONBLOCK;
|
||||
}
|
||||
else {
|
||||
mode |= O_NDELAY;
|
||||
mode |= O_NONBLOCK;
|
||||
}
|
||||
if (fcntl(fd, F_SETFL, mode) == -1) {
|
||||
throwError(errno);
|
||||
|
|
Loading…
Reference in New Issue