From: wessels <> Date: Fri, 23 Feb 2001 04:05:56 +0000 (+0000) Subject: Changed the way that we pick between O_NDELAY and O_NONBLOCK for X-Git-Tag: SQUID_3_0_PRE1~1591 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aee72e14742ed6854a1ff1e43099456552b4cd61;p=thirdparty%2Fsquid.git Changed the way that we pick between O_NDELAY and O_NONBLOCK for 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. --- diff --git a/src/squid.h b/src/squid.h index 8ad9b41011..b79aaaa391 100644 --- a/src/squid.h +++ b/src/squid.h @@ -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 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 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