]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed the way that we pick between O_NDELAY and O_NONBLOCK for
authorwessels <>
Fri, 23 Feb 2001 04:05:56 +0000 (04:05 +0000)
committerwessels <>
Fri, 23 Feb 2001 04:05:56 +0000 (04:05 +0000)
Solaris.  From way back we always used O_NDELAY rather than O_NONBLOCK
for SunOS and Solaris.  The actual reasons why we assumed O_NONBLOCK is
broken are forgotten.

Recent evidence indicates that O_NONBLOCK on Solaris (v8) works
correctly and is actually required for detecting EOF on kernel
pipes (e.g. with diskd).

This change will make solaris use O_NONBLOCK if its defined.

src/squid.h

index 8ad9b410111654513100f8a6ee1746ce08d5eec2..b79aaaa391265dd666c245ac8cc5a87179fd4faa 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.211 2001/01/14 14:18:18 hno Exp $
+ * $Id: squid.h,v 1.212 2001/02/22 21:05:56 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -431,11 +431,27 @@ struct rusage {
 #endif
 
 /*
- * Hey dummy, don't be tempted to move this to lib/config.h.in again.  O_NONBLOCK
- * will not be defined there because you didn't #include <fcntl.h> yet.
+ * Hey dummy, don't be tempted to move this to lib/config.h.in
+ * again.  O_NONBLOCK will not be defined there because you didn't
+ * #include <fcntl.h> yet.
  */
-#if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_)
+#if defined(_SQUID_SUNOS_)
+/*
+ * We assume O_NONBLOCK is broken, or does not exist, on SunOS.
+ */
+#define SQUID_NONBLOCK O_NDELAY
+#elif defined(O_NONBLOCK)
+/*
+ * We used to assume O_NONBLOCK was broken on Solaris, but evidence
+ * now indicates that its fine on Solaris 8, and in fact required for
+ * properly detecting EOF on FIFOs.  So now we assume that if 
+ * its defined, it works correctly on all operating systems.
+ */
+#if defined(O_NONBLOCK)
 #define SQUID_NONBLOCK O_NONBLOCK
+/*
+ * O_NDELAY is our fallback.
+ */
 #else
 #define SQUID_NONBLOCK O_NDELAY
 #endif