From 9c9db6958f6989930bce57f8a26d7d58135e7cca Mon Sep 17 00:00:00 2001 From: crs Date: Thu, 10 Jun 2004 19:56:35 +0000 Subject: [PATCH] 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. --- lib/arch/CArchNetworkBSD.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/arch/CArchNetworkBSD.cpp b/lib/arch/CArchNetworkBSD.cpp index 60253b00..e2efc8da 100644 --- a/lib/arch/CArchNetworkBSD.cpp +++ b/lib/arch/CArchNetworkBSD.cpp @@ -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);