From bed704f74f089ea0947008863721ab3784550eca Mon Sep 17 00:00:00 2001 From: serassio <> Date: Sun, 26 Feb 2006 17:56:29 +0000 Subject: [PATCH] Bug #1484: Hangs at 100% CPU if /dev/null is not accessible If the permissions of /dev/null is set incorrectly Squid hangs at 100% CPU while starting helpers. Forward port of 2.5 patch. --- src/ipc.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ipc.cc b/src/ipc.cc index f7e325d0cd..70911465a3 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.41 2005/06/04 23:57:05 hno Exp $ + * $Id: ipc.cc,v 1.42 2006/02/26 10:56:29 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -341,11 +341,12 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name */ do { - x = open(_PATH_DEVNULL, 0, 0444); + /* First make sure 0-2 is occupied by something. Gets cleaned up later */ + x = dup(crfd); + assert(x > -1); + } while (x < 3 && x > -1); - if (x > -1) - commSetCloseOnExec(x); - } while (x < 3); + close(x); t1 = dup(crfd); -- 2.47.3