From e4a1325e3dbaf32e22224ab07536fe856202e870 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Mon, 9 Jun 2003 05:27:50 +0000 Subject: [PATCH] check open("/dev/null") return value for errors. Especially important later in ipcCreate() where Squid stays in a do loop if it cannot open /dev/null. --- src/main.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 24f38b74c0..810729de16 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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) { -- 2.47.2