]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/comm.cc
merge changes from SQUID_2_3 branch
[thirdparty/squid.git] / src / comm.cc
index f9fb0bf768b93f19a0cb188594eff958b765c644..87a1b9da35603b81a55a5d11b02d2c65ecba64ee 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.303 1999/10/04 05:05:06 wessels Exp $
+ * $Id: comm.cc,v 1.304 1999/12/30 17:36:27 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -720,6 +720,23 @@ commSetNonBlocking(int fd)
     return 0;
 }
 
+int
+commUnsetNonBlocking(int fd)
+{
+    int flags;
+    int dummy = 0;
+    if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
+       debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
+       return COMM_ERROR;
+    }
+    if (fcntl(fd, F_SETFL, flags & (~SQUID_NONBLOCK)) < 0) {
+       debug(50, 0) ("commUnsetNonBlocking: FD %d: %s\n", fd, xstrerror());
+       return COMM_ERROR;
+    }
+    fd_table[fd].flags.nonblocking = 0;
+    return 0;
+}
+
 void
 commSetCloseOnExec(int fd)
 {