httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread mpmt_pthread.c
Date Fri, 23 Jun 2000 20:03:02 GMT
trawick     00/06/23 13:02:59

  Modified:    src/modules/mpm/mpmt_pthread mpmt_pthread.c
  Log:
  Clean up the APR-ization of the pipe of death.
  
  Revision  Changes    Path
  1.96      +12 -10    apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- mpmt_pthread.c	2000/06/23 18:12:44	1.95
  +++ mpmt_pthread.c	2000/06/23 20:02:58	1.96
  @@ -913,6 +913,7 @@
       int last_non_dead;
       int total_non_dead;
       int one = 1;
  +    ap_status_t rv;
   
       /* initialize the free_list */
       free_length = 0;
  @@ -967,8 +968,8 @@
       if (idle_thread_count > max_spare_threads) {
           /* Kill off one child */
           char char_of_death = '!';
  -        if (ap_write(pipe_of_death_out, &char_of_death, &one) != APR_SUCCESS) {
  -            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "write pipe_of_death");
  +        if ((rv = ap_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS)
{
  +            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death");
           }
           idle_spawn_rate = 1;
       }
  @@ -1091,17 +1092,18 @@
   
       pconf = _pconf;
       ap_server_conf = s;
  -    if (ap_create_pipe(&pipe_of_death_in, &pipe_of_death_out, pconf) == -1) {
  -        ap_log_error(APLOG_MARK, APLOG_ERR, errno,
  +    rv = ap_create_pipe(&pipe_of_death_in, &pipe_of_death_out, pconf);
  +    if (rv != APR_SUCCESS) {
  +        ap_log_error(APLOG_MARK, APLOG_ERR, rv,
                        (const server_rec*) ap_server_conf,
                        "pipe: (pipe_of_death)");
           exit(1);
       }
   
  -    if (ap_set_pipe_timeout(pipe_of_death_in, 0) != APR_SUCCESS) {
  -        ap_log_error(APLOG_MARK, APLOG_ERR, errno,
  +    if ((rv = ap_set_pipe_timeout(pipe_of_death_in, 0)) != APR_SUCCESS) {
  +        ap_log_error(APLOG_MARK, APLOG_ERR, rv,
                        (const server_rec*) ap_server_conf,
  -                     "fcntl: O_NONBLOCKing (pipe_of_death)");
  +                     "ap_set_pipe_timeout (pipe_of_death)");
           exit(1);
       }
       ap_server_conf = s;
  @@ -1217,9 +1219,9 @@
   
   	/* give the children the signal to die */
           for (i = 0; i < ap_daemons_limit;) {
  -            if (ap_write(pipe_of_death_in, &char_of_death, &one) == -1) {
  -                if (errno == EINTR) continue;
  -                ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "write pipe_of_death");
  +            if ((rv = ap_write(pipe_of_death_in, &char_of_death, &one)) != APR_SUCCESS)
{
  +                if (ap_canonical_error(rv) == APR_EINTR) continue;
  +                ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death");
               }
               i++;
           }
  
  
  

Mime
View raw message