From: serassio <> Date: Sun, 26 Feb 2006 17:56:29 +0000 (+0000) Subject: Bug #1484: Hangs at 100% CPU if /dev/null is not accessible X-Git-Tag: SQUID_3_0_PRE4~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bed704f74f089ea0947008863721ab3784550eca;p=thirdparty%2Fsquid.git 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. --- 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);