From: wessels <> Date: Tue, 8 Oct 1996 20:43:30 +0000 (+0000) Subject: move O_NONBLOCK to open() X-Git-Tag: SQUID_3_0_PRE1~5704 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afb9e9df6d28b274e4ee2e8e2656aeb541d329ea;p=thirdparty%2Fsquid.git move O_NONBLOCK to open() --- diff --git a/src/disk.cc b/src/disk.cc index cb74d72d61..c096a1b5c9 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.30 1996/09/26 19:19:42 wessels Exp $ + * $Id: disk.cc,v 1.31 1996/10/08 14:43:30 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -154,7 +154,11 @@ file_open(char *path, int (*handler) _PARAMS((void)), int mode) fatal_dump("file_open: O_RDWR not allowed"); if (mode & O_WRONLY) mode |= O_APPEND; - mode |= O_NDELAY; +#if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_) + mode |= O_NONBLOCK; +#else + mode |= O_NDELAY; +#endif /* Open file */ if ((fd = open(path, mode, 0644)) < 0) { @@ -179,9 +183,10 @@ file_open(char *path, int (*handler) _PARAMS((void)), int mode) conn = &fd_table[fd]; memset(conn, '\0', sizeof(FD_ENTRY)); - if (commSetNonBlocking(fd) == COMM_ERROR) - return DISK_ERROR; - conn->comm_type = COMM_NONBLOCKING; +#ifdef DONT_DO_THIS + if (commSetNonBlocking(fd) != COMM_ERROR) + conn->comm_type = COMM_NONBLOCKING; +#endif return fd; }