httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aa...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Tue, 29 Jan 2002 02:41:46 GMT
aaron       02/01/28 18:41:46

  Modified:    server/mpm/beos beos.c
               server/mpm/perchild perchild.c
               server/mpm/prefork prefork.c
               server/mpm/worker worker.c
  Log:
  Take advantage of the new pre_config return value when apr_proc_detach
  fails. I'll be making some changes to apr_proc_detach, and it will be
  nice to be able to report runtime errors.
  
  Tested on worker but the code changes are identical on other MPMs.
  
  Revision  Changes    Path
  1.81      +9 -2      httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- beos.c	28 Jan 2002 23:49:40 -0000	1.80
  +++ beos.c	29 Jan 2002 02:41:45 -0000	1.81
  @@ -996,6 +996,7 @@
   {
       static int restart_num = 0;
       int no_detach, debug;
  +    apr_status_t rv;
   
       debug = ap_exists_config_define("DEBUG");
   
  @@ -1011,8 +1012,14 @@
       if (restart_num++ == 1) {
           is_graceful = 0;
           
  -        if (!one_process && !no_detach)
  -	        apr_proc_detach();
  +        if (!one_process && !no_detach) {
  +	        rv = apr_proc_detach();
  +            if (rv != APR_SUCCESS) {
  +                ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
  +                             "apr_proc_detach failed");
  +                return HTTP_INTERNAL_SERVER_ERROR;
  +            }                  
  +        }
   
           server_pid = getpid();
       }
  
  
  
  1.104     +7 -1      httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- perchild.c	28 Jan 2002 23:49:40 -0000	1.103
  +++ perchild.c	29 Jan 2002 02:41:45 -0000	1.104
  @@ -1432,6 +1432,7 @@
       int i;
       int tmp_server_limit = DEFAULT_SERVER_LIMIT;
       int tmp_thread_limit = DEFAULT_THREAD_LIMIT;
  +    apr_status_t rv;
   
       debug = ap_exists_config_define("DEBUG");
   
  @@ -1448,7 +1449,12 @@
           is_graceful = 0;
   
           if (!one_process && !no_detach) {
  -            apr_proc_detach();
  +            rv = apr_proc_detach();
  +            if (rv != APR_SUCCESS) {
  +                ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
  +                             "apr_proc_detach failed");
  +                return HTTP_INTERNAL_SERVER_ERROR;
  +            }                  
           }
   
           my_pid = getpid();
  
  
  
  1.234     +9 -3      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.233
  retrieving revision 1.234
  diff -u -r1.233 -r1.234
  --- prefork.c	28 Jan 2002 23:49:40 -0000	1.233
  +++ prefork.c	29 Jan 2002 02:41:46 -0000	1.234
  @@ -1204,6 +1204,7 @@
   {
       static int restart_num = 0;
       int no_detach, debug;
  +    apr_status_t rv;
   
       debug = ap_exists_config_define("DEBUG");
   
  @@ -1219,9 +1220,14 @@
       if (restart_num++ == 1) {
   	is_graceful = 0;
   
  -	if (!one_process && !no_detach) {
  -	    apr_proc_detach();
  -	}
  +    if (!one_process && !no_detach) {
  +        rv = apr_proc_detach();
  +        if (rv != APR_SUCCESS) {
  +            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
  +                         "apr_proc_detach failed");
  +            return HTTP_INTERNAL_SERVER_ERROR;
  +        }
  +    }
   
   	parent_pid = ap_my_pid = getpid();
       }
  
  
  
  1.65      +8 -2      httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- worker.c	28 Jan 2002 23:49:40 -0000	1.64
  +++ worker.c	29 Jan 2002 02:41:46 -0000	1.65
  @@ -1541,12 +1541,13 @@
   }
   
   static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog, 
  -                              apr_pool_t *ptemp)
  +                             apr_pool_t *ptemp)
   {
       static int restart_num = 0;
       int no_detach, debug;
       ap_directive_t *pdir;
       ap_directive_t *max_clients = NULL;
  +    apr_status_t rv;
   
       /* make sure that "ThreadsPerChild" gets set before "MaxClients" */
       for (pdir = ap_conftree; pdir != NULL; pdir = pdir->next) {
  @@ -1599,7 +1600,12 @@
           is_graceful = 0;
   
           if (!one_process && !no_detach) {
  -            apr_proc_detach();
  +            rv = apr_proc_detach();
  +            if (rv != APR_SUCCESS) {
  +                ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
  +                             "apr_proc_detach failed");
  +                return HTTP_INTERNAL_SERVER_ERROR;
  +            }
           }
           parent_pid = ap_my_pid = getpid();
       }
  
  
  

Mime
View raw message