Received: by taz.hyperreal.com (8.6.12/8.6.5) id FAA27015; Thu, 18 Jul 1996 05:20:23 -0700 Received: from arachnet.algroup.co.uk by taz.hyperreal.com (8.6.12/8.6.5) with SMTP id FAA27007; Thu, 18 Jul 1996 05:20:16 -0700 Received: from heap.ben.algroup.co.uk by arachnet.algroup.co.uk id aa00783; 18 Jul 96 13:19 BST Received: from gonzo.ben.algroup.co.uk by heap.ben.algroup.co.uk id aa17894; 18 Jul 96 12:39 BST Subject: cvs commit: apache/src CHANGES conf.h http_main.c (fwd) To: Apache Mailing List Date: Thu, 18 Jul 1996 12:34:09 +0100 (BST) From: Ben Laurie X-Mailer: ELM [version 2.4 PL24 PGP2] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 4557 Message-ID: <9607181234.aa02579@gonzo.ben.algroup.co.uk> Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com Seems to me that this patch should probably go into 1.1.2... Cheers, Ben. Ben Laurie wrote: > From heap.ben.algroup.co.uk!arachnet-fw.algroup.co.uk!taz.hyperreal.com!hyperreal.com!owner-apache-cvs Wed Jul 17 23:35:58 1996 > Date: Wed, 17 Jul 1996 16:20:53 -0700 > From: Ben Laurie > Message-Id: <199607172320.QAA20266@taz.hyperreal.com> > To: apache-cvs@hyperreal.com > Subject: cvs commit: apache/src CHANGES conf.h http_main.c > Sender: owner-apache-cvs@hyperreal.com > Precedence: bulk > > ben 96/07/17 16:20:52 > > Modified: src CHANGES conf.h http_main.c > Log: > Work around broken wait() behaviour in Irix (and perhaps others). > > Revision Changes Path > 1.44 +4 -0 apache/src/CHANGES > > Index: CHANGES > =================================================================== > RCS file: /export/home/cvs/apache/src/CHANGES,v > retrieving revision 1.43 > retrieving revision 1.44 > diff -C3 -r1.43 -r1.44 > *** CHANGES 1996/07/17 08:33:40 1.43 > --- CHANGES 1996/07/17 23:20:47 1.44 > *************** > *** 6,11 **** > --- 6,15 ---- > *) Graceful restart code added. This allows the server to restart without > losing current connections on receipt of signal 2 (SIGINT). [Ben Laurie] > > + *) Added BROKEN_WAIT flag to conf.h, to be used on systems which fail to > + reap their children correctly (symptom: mod_status shows children which > + don't exist). [Ben Laurie] > + > Changes with Apache 1.1.1: > > *) Fixed bug where Cookie module would make two entries in the > > > > 1.22 +1 -0 apache/src/conf.h > > Index: conf.h > =================================================================== > RCS file: /export/home/cvs/apache/src/conf.h,v > retrieving revision 1.21 > retrieving revision 1.22 > diff -C3 -r1.21 -r1.22 > *** conf.h 1996/07/17 15:09:58 1.21 > --- conf.h 1996/07/17 23:20:49 1.22 > *************** > *** 94,99 **** > --- 94,100 ---- > #define HAVE_SHMGET > #define HAVE_CRYPT_H > #define NO_LONG_DOUBLE > + #define BROKEN_WAIT > > #elif defined(HPUX) || defined(HPUX10) > #define HAVE_RESOURCE > > > > 1.51 +29 -2 apache/src/http_main.c > > Index: http_main.c > =================================================================== > RCS file: /export/home/cvs/apache/src/http_main.c,v > retrieving revision 1.50 > retrieving revision 1.51 > diff -C3 -r1.50 -r1.51 > *** http_main.c 1996/07/16 22:14:54 1.50 > --- http_main.c 1996/07/17 23:20:50 1.51 > *************** > *** 937,945 **** > #endif > } > > int wait_or_timeout (int *status) > { > ! wait_or_timeout_retval = -1; > > #if defined(NEXT) > if (setjmp(wait_timeout_buf) != 0) { > --- 937,966 ---- > #endif > } > > + #ifdef BROKEN_WAIT > + /* > + Some systems appear to fail to deliver dead children to wait() at times. > + This sorts them out. > + */ > + void reap_children() > + { > + int status,n; > + > + for(n=0 ; n < HARD_SERVER_LIMIT ; ++n) > + if(scoreboard_image->servers[n].status != SERVER_DEAD > + && waitpid(scoreboard_image->servers[n].pid,&status,WNOHANG) == -1 > + && errno == ECHILD) > + { > + sync_scoreboard_image(); > + update_child_status(n,SERVER_DEAD,NULL); > + } > + } > + #endif > + > int wait_or_timeout (int *status) > { > ! int wait_or_timeout_retval = -1; > ! static int ntimes; > > #if defined(NEXT) > if (setjmp(wait_timeout_buf) != 0) { > *************** > *** 949,955 **** > errno = ETIMEDOUT; > return wait_or_timeout_retval; > } > ! > signal (SIGALRM, longjmp_out_of_alarm); > alarm(1); > #if defined(NEXT) > --- 970,982 ---- > errno = ETIMEDOUT; > return wait_or_timeout_retval; > } > ! #ifdef BROKEN_WAIT > ! if(++ntimes == 60) > ! { > ! reap_children(); > ! ntimes=0; > ! } > ! #endif > signal (SIGALRM, longjmp_out_of_alarm); > alarm(1); > #if defined(NEXT) > > > -- Ben Laurie Phone: +44 (181) 994 6435 Freelance Consultant and Fax: +44 (181) 994 6472 Technical Director Email: ben@algroup.co.uk A.L. Digital Ltd, URL: http://www.algroup.co.uk London, England. Apache Group member (http://www.apache.org)