mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 14:41:57 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user