httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/prefork prefork.c
Date Wed, 23 Apr 2003 14:59:35 GMT
trawick     2003/04/23 07:59:35

  Modified:    server/mpm/prefork prefork.c
  Log:
  improve -DONE_PROCESS handling with prefork MPM so that
  it returns from ap_mpm_run() and allows core Apache code
  to run any required cleanups
  
  this resolves problems such as semaphore leaks and
  shared memory that isn't cleaned up
  
  (some necessary re-indention to be done in a separate
  commit; otherwise, this would be a difficult commit
  to review)
  
  Revision  Changes    Path
  1.275     +13 -4     httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.274
  retrieving revision 1.275
  diff -u -r1.274 -r1.275
  --- prefork.c	9 Apr 2003 16:58:30 -0000	1.274
  +++ prefork.c	23 Apr 2003 14:59:35 -0000	1.275
  @@ -585,6 +585,9 @@
                   ret = apr_poll(pollset, num_listensocks, &n, -1);
                   if (ret != APR_SUCCESS) {
                       if (APR_STATUS_IS_EINTR(ret)) {
  +                        if (one_process && shutdown_pending) {
  +                            return;
  +                        }
                           continue;
                       }
       	            /* Single Unix documents select as returning errnos
  @@ -630,6 +633,9 @@
                   /* resource shortage or should-not-occur occured */
                   clean_child_exit(1);
               }
  +            if (APR_STATUS_IS_EINTR(status) && one_process && shutdown_pending)
{
  +                return;
  +            }
           }
   	SAFE_ACCEPT(accept_mutex_off());	/* unlock after "accept" */
   
  @@ -673,14 +679,15 @@
       }
   
       if (one_process) {
  -	apr_signal(SIGHUP, just_die);
  +	apr_signal(SIGHUP, sig_term);
           /* Don't catch AP_SIG_GRACEFUL in ONE_PROCESS mode :) */
  -	apr_signal(SIGINT, just_die);
  +	apr_signal(SIGINT, sig_term);
   #ifdef SIGQUIT
   	apr_signal(SIGQUIT, SIG_DFL);
   #endif
  -	apr_signal(SIGTERM, just_die);
  +	apr_signal(SIGTERM, sig_term);
   	child_main(slot);
  +        return 0;
       }
   
       (void) ap_update_child_status_from_indexes(slot, 0, SERVER_STARTING,
  @@ -950,8 +957,9 @@
   
       if (one_process) {
           AP_MONCONTROL(1);
  +        make_child(ap_server_conf, 0);
       }
  -
  +    else {
       if (ap_daemons_max_free < ap_daemons_min_free + 1)	/* Don't thrash... */
   	ap_daemons_max_free = ap_daemons_min_free + 1;
   
  @@ -1071,6 +1079,7 @@
       sleep(1);
   #endif /*TPF */
       }
  +    } /* one_process */
   
       if (shutdown_pending) {
   	/* Time to gracefully shut down:
  
  
  

Mime
View raw message