]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
check open("/dev/null") return value for errors. Especially important
authorwessels <>
Mon, 9 Jun 2003 05:27:50 +0000 (05:27 +0000)
committerwessels <>
Mon, 9 Jun 2003 05:27:50 +0000 (05:27 +0000)
later in ipcCreate() where Squid stays in a do loop if it cannot
open /dev/null.

src/main.cc

index 24f38b74c0278031d61a480069eff51f5fcdae3b..810729de16d1b8f141787d07b5797040b00917ea 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.379 2003/05/06 00:29:45 hno Exp $
+ * $Id: main.cc,v 1.380 2003/06/08 23:27:50 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -1320,6 +1320,9 @@ watch_child(char *argv[])
     /* Connect stdio to /dev/null in daemon mode */
     nullfd = open("/dev/null", O_RDWR | O_TEXT);
 
+    if (nullfd < 0)
+        fatalf("/dev/null: %s\n", xstrerror());
+
     dup2(nullfd, 0);
 
     if (opt_debug_stderr < 0) {