You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2004/02/27 15:37:04 UTC
cvs commit: apr/network_io/unix sockopt.c
trawick 2004/02/27 06:37:04
Modified: network_io/unix sockopt.c
Log:
fix some compile and/or run-time bogosity on Unix-ish platforms
with no O_NDELAY or FNDELAY flags
this has been here since apr time zero when it was mis-copied
from Apache httpd 1.3's buff.c, so perhaps this doesn't actually
make anyone's life easer
Discovered by: Joe Orton
Revision Changes Path
1.77 +4 -6 apr/network_io/unix/sockopt.c
Index: sockopt.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- sockopt.c 13 Feb 2004 09:38:33 -0000 1.76
+++ sockopt.c 27 Feb 2004 14:37:03 -0000 1.77
@@ -29,10 +29,9 @@
#elif defined(O_NDELAY)
fd_flags &= ~O_NDELAY;
#elif defined(FNDELAY)
- fd_flags &= ~O_FNDELAY;
+ fd_flags |= FNDELAY;
#else
- /* XXXX: this breaks things, but an alternative isn't obvious...*/
- return -1;
+#error Please teach APR how to make sockets blocking on your platform.
#endif
if (fcntl(sd, F_SETFL, fd_flags) == -1) {
return errno;
@@ -56,10 +55,9 @@
#elif defined(O_NDELAY)
fd_flags |= O_NDELAY;
#elif defined(FNDELAY)
- fd_flags |= O_FNDELAY;
+ fd_flags |= FNDELAY;
#else
- /* XXXX: this breaks things, but an alternative isn't obvious...*/
- return -1;
+#error Please teach APR how to make sockets non-blocking on your platform.
#endif
if (fcntl(sd, F_SETFL, fd_flags) == -1) {
return errno;