httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apache-1.3/src/support suexec.c
Date Wed, 05 Mar 2003 15:50:30 GMT
martin      2003/03/05 07:50:29

  Modified:    src/support suexec.c
  Log:
  Fix longstanding BS2000(OSD_POSIX) related bug -- a CGI program which
  terminated quickly would cause an endless loop.
  ;-) Nobody noticed by now, so I guess few people used it.
  
  Revision  Changes    Path
  1.62      +3 -2      apache-1.3/src/support/suexec.c
  
  Index: suexec.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/suexec.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- suexec.c	22 Feb 2003 18:00:31 -0000	1.61
  +++ suexec.c	5 Mar 2003 15:50:29 -0000	1.62
  @@ -419,7 +419,7 @@
        * Initialize BS2000 user environment
        */
       {
  -	pid_t pid;
  +	pid_t pid, reaped;
   	int status;
   
   	switch (pid = ufork(target_uname))
  @@ -432,7 +432,8 @@
   	case 0:	/* Child */
   	    break;
   	default:	/* Father */
  -	    while (pid != waitpid(pid, &status, 0))
  +	    while (pid != (reaped = waitpid(pid, &status, 0))
  +		   && (reaped != -1 || errno != ECHILD))
   		;
   	    /* @@@ FIXME: should we deal with STOP signals as well? */
   	    if (WIFSIGNALED(status)) {
  
  
  

Mime
View raw message