--------------------- PatchSet 206 Date: 2002/11/27 14:22:58 Author: rbcollins Branch: external_logger Tag: (none) Log: prevent race condition dropping helper status at startup Members: src/ipc.cc:1.5.4.2->1.5.4.3 Index: squid3/src/ipc.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipc.cc,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -u -r1.5.4.2 -r1.5.4.3 --- squid3/src/ipc.cc 27 Nov 2002 14:00:50 -0000 1.5.4.2 +++ squid3/src/ipc.cc 27 Nov 2002 14:22:58 -0000 1.5.4.3 @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.5.4.2 2002/11/27 14:00:50 rbcollins Exp $ + * $Id: ipc.cc,v 1.5.4.3 2002/11/27 14:22:58 rbcollins Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -583,6 +583,16 @@ handler->event = event; handler->data = data; dlinkAddTail(handler, &handler->node, &ipc_quit_handlers); + /* Check that this process hasn't already quit */ + +#ifndef _SQUID_NEXT_ + int status; + pid_t waitrv; + + waitrv = waitpid(pid, &status, WNOHANG); + if (waitrv > 0) + ipcCallQuitHandlers (waitrv); +#endif } void