#elif defined(__DragonFly__)
#define _SQUID_DRAGONFLY_ 1
-#elif defined(__CYGWIN32__) || defined(__CYGWIN__)
+#elif defined(__CYGWIN__)
#define _SQUID_CYGWIN_ 1
-#define _SQUID_WINDOWS_ 1
#elif defined(__MINGW32__) || defined(__MINGW__)
#define _SQUID_MINGW_ 1
fi
AC_SUBST(CGIEXT)
-AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,
- [test "x$squid_host_os" = "xmingw" -o "x$squid_host_os" = "xcygwin"])
+AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,[test "x$squid_host_os" = "xmingw"])
AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
case "$squid_host_os" in
])
if test "x${enable_eui:=yes}" = "xyes" ; then
case "$squid_host_os" in
- linux|solaris|freebsd|openbsd|netbsd)
+ linux|solaris|freebsd|openbsd|netbsd|cygwin)
${TRUE}
;;
- cygwin|mingw)
+ mingw)
EUILIB="-liphlpapi"
;;
*)
int
commSetNonBlocking(int fd)
{
-#if !_SQUID_WINDOWS_
- int flags;
- int dummy = 0;
-#endif
#if _SQUID_WINDOWS_
int nonblocking = TRUE;
-#if _SQUID_CYGWIN_
- if (fd_table[fd].type != FD_PIPE) {
-#endif
-
- if (ioctl(fd, FIONBIO, &nonblocking) < 0) {
- debugs(50, 0, "commSetNonBlocking: FD " << fd << ": " << xstrerror() << " " << fd_table[fd].type);
- return Comm::COMM_ERROR;
- }
-
-#if _SQUID_CYGWIN_
- } else {
-#endif
-#endif
-#if !_SQUID_WINDOWS_
+ if (ioctl(fd, FIONBIO, &nonblocking) < 0) {
+ debugs(50, 0, "commSetNonBlocking: FD " << fd << ": " << xstrerror() << " " << fd_table[fd].type);
+ return Comm::COMM_ERROR;
+ }
- if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
- debugs(50, 0, "FD " << fd << ": fcntl F_GETFL: " << xstrerror());
- return Comm::COMM_ERROR;
- }
+#else
+ int flags;
+ int dummy = 0;
- if (fcntl(fd, F_SETFL, flags | SQUID_NONBLOCK) < 0) {
- debugs(50, 0, "commSetNonBlocking: FD " << fd << ": " << xstrerror());
- return Comm::COMM_ERROR;
- }
+ if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
+ debugs(50, 0, "FD " << fd << ": fcntl F_GETFL: " << xstrerror());
+ return Comm::COMM_ERROR;
+ }
-#endif
-#if _SQUID_CYGWIN_
+ if (fcntl(fd, F_SETFL, flags | SQUID_NONBLOCK) < 0) {
+ debugs(50, 0, "commSetNonBlocking: FD " << fd << ": " << xstrerror());
+ return Comm::COMM_ERROR;
}
#endif
- fd_table[fd].flags.nonblocking = true;
+ fd_table[fd].flags.nonblocking = true;
return 0;
}
idnsParseResolvConf(void)
{
bool result = false;
-#if !_SQUID_WINDOWS_ || _SQUID_CYGWIN_
+#if !_SQUID_WINDOWS_
FILE *fp = fopen(_PATH_RESCONF, "r");
if (fp == NULL) {
return false;
}
-#if _SQUID_CYGWIN_
- setmode(fileno(fp), O_TEXT);
-#endif
-
char buf[RESOLV_BUFSZ];
const char *t = NULL;
while (fgets(buf, RESOLV_BUFSZ, fp)) {
}
#endif /* HAVE_SETRLIMIT */
-#if HAVE_SETRLIMIT && defined(RLIMIT_DATA)
+#if HAVE_SETRLIMIT && defined(RLIMIT_DATA) && !_SQUID_CYGWIN_
if (getrlimit(RLIMIT_DATA, &rl) < 0) {
debugs(50, DBG_CRITICAL, "getrlimit: RLIMIT_DATA: " << xstrerror());
} else if (rl.rlim_max > rl.rlim_cur) {
debugs(50, DBG_IMPORTANT, "NOTICE: Could not increase the number of filedescriptors");
}
-#if HAVE_SETRLIMIT && defined(RLIMIT_VMEM)
+#if HAVE_SETRLIMIT && defined(RLIMIT_VMEM) && !_SQUID_CYGWIN_
if (getrlimit(RLIMIT_VMEM, &rl) < 0) {
debugs(50, DBG_CRITICAL, "getrlimit: RLIMIT_VMEM: " << xstrerror());
} else if (rl.rlim_max > rl.rlim_cur) {