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:
crs 2004-06-10 19:56:35 +00:00
parent 613413fb50
commit 9c9db6958f
1 changed files with 2 additions and 2 deletions

View File

@ -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);