httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/support rotatelogs.c
Date Thu, 04 May 2000 04:02:40 GMT
rbb         00/05/03 21:02:38

  Modified:    .        STATUS
               src      CHANGES
               src/include ap_ac_config.h ap_mpm.h
               src/main http_log.c http_main.c
               src/modules/mpm/dexter dexter.c
               src/modules/mpm/mpmt_beos mpmt_beos.c
               src/modules/mpm/mpmt_pthread mpmt_pthread.c
               src/modules/mpm/prefork prefork.c
               src/modules/mpm/spmt_os2 spmt_os2.c
               src/modules/standard mod_cgid.c
               src/support rotatelogs.c
  Log:
  Make reliable piped logs work on 2.0.
  
  Revision  Changes    Path
  1.59      +1 -6      apache-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/apache-2.0/STATUS,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- STATUS	2000/05/01 21:52:18	1.58
  +++ STATUS	2000/05/04 04:02:10	1.59
  @@ -1,5 +1,5 @@
   Apache 2.0 STATUS:
  -Last modified at [$Date: 2000/05/01 21:52:18 $]
  +Last modified at [$Date: 2000/05/04 04:02:10 $]
   
   Release:
   
  @@ -30,11 +30,6 @@
           cleanups for each socket. Move socket close code out of
           http_connection.c and into the MPMs.
   	Status:
  -
  -    * Reliable piped logs look broken everywhere. Each MPM includes essentially
  -	identical code to ap_register_other_child(), etc. Most of this code can
  -	be moved out of the MPMs and into some common file (http_core.c?).
  -	Dean says presumably you mean an os-specific file?
   
       * Put back resource limit code
   
  
  
  
  1.102     +2 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- CHANGES	2000/05/03 17:55:38	1.101
  +++ CHANGES	2000/05/04 04:02:13	1.102
  @@ -1,4 +1,6 @@
   Changes with Apache 2.0a4-dev
  +  *) Reliable piped logs work in 2.0.
  +     [Ryan Bloom]
   
     *) Introduce a hash table implementation into APR to be used for
        replacing tables and other random data structures in Apache.
  
  
  
  1.15      +4 -4      apache-2.0/src/include/ap_ac_config.h
  
  Index: ap_ac_config.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_ac_config.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ap_ac_config.h	2000/04/29 23:57:55	1.14
  +++ ap_ac_config.h	2000/05/04 04:02:14	1.15
  @@ -213,10 +213,10 @@
   extern int strncasecmp(const char *, const char *, unsigned);
   #endif /* SCO5 */
   
  -/* When we don't have the OTHER_CHILD routines (always, right now), turn off
  - * reliable piped_logs. */
  -#if !defined(HAVE_OTHER_CHILD) && defined(HAVE_RELIABLE_PIPED_LOGS)
  -#undef HAVE_RELIABLE_PIPED_LOGS
  +/* If APR has OTHER_CHILD logic, use reliable piped logs.
  + */
  +#if (APR_HAS_OTHER_CHILD)
  +#define HAVE_RELIABLE_PIPED_LOGS TRUE
   #endif
   
   /* XXX - The PHP4 comments say -D_HPUX_SOURCE is obsolete. */
  
  
  
  1.12      +0 -40     apache-2.0/src/include/ap_mpm.h
  
  Index: ap_mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_mpm.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ap_mpm.h	2000/04/14 15:58:16	1.11
  +++ ap_mpm.h	2000/05/04 04:02:15	1.12
  @@ -130,44 +130,4 @@
    */
   void ap_signal_parent(ap_pool_t *p, const char* signal, const char* server_root);
   
  -#ifdef HAS_OTHER_CHILD
  -/*
  - * register an other_child -- a child which the main loop keeps track of
  - * and knows it is different than the rest of the scoreboard.
  - *
  - * pid is the pid of the child.
  - *
  - * maintenance is a function that is invoked with a reason, the data
  - * pointer passed here, and when appropriate a status result from waitpid().
  - *
  - * write_fd is an fd that is probed for writing by select() if it is ever
  - * unwritable, then maintenance is invoked with reason OC_REASON_UNWRITABLE.
  - * This is useful for log pipe children, to know when they've blocked.  To
  - * disable this feature, use -1 for write_fd.
  - */
  -API_EXPORT(void) ap_register_other_child(int pid,
  -       void (*maintenance) (int reason, void *data, ap_wait_t status), void *data,
  -				      int write_fd);
  -#define OC_REASON_DEATH		0	/* child has died, caller must call
  -					 * unregister still */
  -#define OC_REASON_UNWRITABLE	1	/* write_fd is unwritable */
  -#define OC_REASON_RESTART	2	/* a restart is occuring, perform
  -					 * any necessary cleanup (including
  -					 * sending a special signal to child)
  -					 */
  -#define OC_REASON_UNREGISTER	3	/* unregister has been called, do
  -					 * whatever is necessary (including
  -					 * kill the child) */
  -#define OC_REASON_LOST		4	/* somehow the child exited without
  -					 * us knowing ... buggy os? */
  -
  -/*
  - * unregister an other_child.  Note that the data pointer is used here, and
  - * is assumed to be unique per other_child.  This is because the pid and
  - * write_fd are possibly killed off separately.
  - */
  -API_EXPORT(void) ap_unregister_other_child(void *data);
  -
  -#endif
  -
   #endif
  
  
  
  1.45      +18 -15    apache-2.0/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_log.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- http_log.c	2000/04/30 21:21:51	1.44
  +++ http_log.c	2000/05/04 04:02:16	1.45
  @@ -594,15 +594,12 @@
       ap_os_proc_t pid;
       ap_proc_t *procnew;
   
  -    /* pjr - calls to block and unblock alarms weren't here before, was this */
  -    /*       an oversight or intentional?                                    */
  -
   #ifdef SIGHUP
       ap_signal(SIGHUP, SIG_IGN);
   #endif
       if ((ap_createprocattr_init(&procattr, pl->p)         != APR_SUCCESS) ||
  -        (ap_setprocattr_dir(procattr, pl->program)        != APR_SUCCESS) ||
  -        (ap_set_childin(procattr, ap_piped_log_read_fd(pl), ap_piped_log_write_fd(pl))
!= APR_SUCCESS)) {
  +        (ap_setprocattr_childin(procattr, ap_piped_log_read_fd(pl), 
  +                                ap_piped_log_write_fd(pl)) != APR_SUCCESS)) {
           /* Something bad happened, give up and go away. */
   	ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
   	    "piped_log_spawn: unable to exec '%s': %s",
  @@ -610,7 +607,13 @@
           rc = -1;
       }
       else {
  -        rc = ap_create_process(&procnew, pl->program, NULL, NULL, procattr, pl->p);
  +        char **args;
  +        const char *pname;
  +
  +        ap_tokenize_to_argv(pl->program, &args, pl->p);
  +        pname = ap_pstrdup(pl->p, args[0]);
  + 
  +        rc = ap_create_process(&procnew, pname, args, NULL, procattr, pl->p);
       
           if (rc == APR_SUCCESS) {            
               /* pjr - This no longer happens inside the child, */
  @@ -618,13 +621,11 @@
               /*   successful that the child is running.        */
               RAISE_SIGSTOP(PIPED_LOG_SPAWN); 
               pl->pid = procnew;
  -            ap_get_os_proc(&pid, procnew);
  -            ap_register_other_child(pid, piped_log_maintenance, pl, ap_piped_log_write_fd(pl));
  +            ap_register_other_child(procnew, piped_log_maintenance, pl, 
  +                                    ap_piped_log_write_fd(pl), pl->p);
           }
       }
       
  -/*  ap_unblock_alarms(); */
  -    
       return 0;
   }
   
  @@ -634,8 +635,8 @@
       piped_log *pl = data;
   
       switch (reason) {
  -    case OC_REASON_DEATH:
  -    case OC_REASON_LOST:
  +    case APR_OC_REASON_DEATH:
  +    case APR_OC_REASON_LOST:
   	pl->pid = NULL;
   	ap_unregister_other_child(pl);
   	if (pl->program == NULL) {
  @@ -651,20 +652,20 @@
   	}
   	break;
       
  -    case OC_REASON_UNWRITABLE:
  +    case APR_OC_REASON_UNWRITABLE:
   	if (pl->pid != NULL) {
   	    ap_kill(pl->pid, SIGTERM);
   	}
   	break;
       
  -    case OC_REASON_RESTART:
  +    case APR_OC_REASON_RESTART:
   	pl->program = NULL;
   	if (pl->pid != NULL) {
   	    ap_kill(pl->pid, SIGTERM);
   	}
   	break;
   
  -    case OC_REASON_UNREGISTER:
  +    case APR_OC_REASON_UNREGISTER:
   	break;
       }
   }
  @@ -706,6 +707,8 @@
   	errno = save_errno;
   	return NULL;
       }
  +    ap_block_pipe(ap_piped_log_read_fd(pl));
  +    ap_block_pipe(ap_piped_log_write_fd(pl));
       ap_register_cleanup(p, pl, piped_log_cleanup, piped_log_cleanup_for_exec);
       if (piped_log_spawn(pl) == -1) {
   	int save_errno = errno;
  
  
  
  1.43      +2 -2      apache-2.0/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- http_main.c	2000/04/14 15:58:55	1.42
  +++ http_main.c	2000/05/04 04:02:17	1.43
  @@ -136,8 +136,8 @@
   #ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
       printf(" -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT\n");
   #endif
  -#ifdef HAS_OTHER_CHILD
  -    printf(" -D HAS_OTHER_CHILD\n");
  +#ifdef APR_HAS_OTHER_CHILD
  +    printf(" -D APR_HAS_OTHER_CHILD\n");
   #endif
   #ifdef HAVE_RELIABLE_PIPED_LOGS
       printf(" -D HAVE_RELIABLE_PIPED_LOGS\n");
  
  
  
  1.73      +2 -2      apache-2.0/src/modules/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- dexter.c	2000/04/30 21:42:46	1.72
  +++ dexter.c	2000/05/04 04:02:20	1.73
  @@ -283,7 +283,7 @@
       ++wait_or_timeout_counter;
       if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
   	wait_or_timeout_counter = 0;
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	probe_writable_fds();
   #endif
       }
  @@ -1110,7 +1110,7 @@
   		    make_child(server_conf, child_slot, time(NULL));
   		    --remaining_children_to_start;
   		}
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	    }
   	    else if (reap_other_child(pid, status) == 0) {
   		/* handled */
  
  
  
  1.22      +3 -152    apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c
  
  Index: mpmt_beos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mpmt_beos.c	2000/04/14 15:59:01	1.21
  +++ mpmt_beos.c	2000/05/04 04:02:23	1.22
  @@ -145,20 +145,6 @@
   int raise_sigstop_flags;
   #endif
   
  -#ifdef HAS_OTHER_CHILD
  -/* used to maintain list of children which aren't part of the scoreboard */
  -typedef struct other_child_rec other_child_rec;
  -struct other_child_rec {
  -    other_child_rec *next;
  -    int pid;
  -    void (*maintenance) (int, void *, ap_wait_t);
  -    void *data;
  -    int write_fd;
  -};
  -static other_child_rec *other_children;
  -#endif
  -
  -
   /* Global, alas, so http_core can talk to us */
   enum server_token_type ap_server_tokens = SrvTk_FULL;
   
  @@ -182,117 +168,6 @@
       exit(code);
   }
   
  -/*****************************************************************
  - * dealing with other children
  - */
  -
  -#ifdef HAS_OTHER_CHILD
  -API_EXPORT(void) ap_register_other_child(int pid,
  -		       void (*maintenance) (int reason, void *, ap_wait_t status),
  -			  void *data, int write_fd)
  -{
  -    other_child_rec *ocr;
  -
  -    ocr = ap_palloc(pconf, sizeof(*ocr));
  -    ocr->pid = pid;
  -    ocr->maintenance = maintenance;
  -    ocr->data = data;
  -    ocr->write_fd = write_fd;
  -    ocr->next = other_children;
  -    other_children = ocr;
  -}
  -
  -/* note that since this can be called by a maintenance function while we're
  - * scanning the other_children list, all scanners should protect themself
  - * by loading ocr->next before calling any maintenance function.
  - */
  -API_EXPORT(void) ap_unregister_other_child(void *data)
  -{
  -    other_child_rec **pocr, *nocr;
  -
  -    for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) {
  -	if ((*pocr)->data == data) {
  -	    nocr = (*pocr)->next;
  -	    (*(*pocr)->maintenance) (OC_REASON_UNREGISTER, (*pocr)->data, -1);
  -	    *pocr = nocr;
  -	    /* XXX: um, well we've just wasted some space in pconf ? */
  -	    return;
  -	}
  -    }
  -}
  -
  -/* test to ensure that the write_fds are all still writable, otherwise
  - * invoke the maintenance functions as appropriate */
  -static void probe_writable_fds(void)
  -{
  -    return;
  -#if 0
  -    fd_set writable_fds;
  -    int fd_max;
  -    other_child_rec *ocr, *nocr;
  -    struct timeval tv;
  -    int rc;
  -
  -    if (other_children == NULL)
  -	return;
  -
  -    fd_max = 0;
  -    FD_ZERO(&writable_fds);
  -    do {
  -	for (ocr = other_children; ocr; ocr = ocr->next) {
  -	    if (ocr->write_fd == -1)
  -		continue;
  -	    FD_SET(ocr->write_fd, &writable_fds);
  -	    if (ocr->write_fd > fd_max) {
  -		fd_max = ocr->write_fd;
  -	    }
  -	}
  -	if (fd_max == 0)
  -	    return;
  -
  -	tv.tv_sec = 0;
  -	tv.tv_usec = 0;
  -	rc = ap_select(fd_max + 1, NULL, &writable_fds, NULL, &tv);
  -    } while (rc == -1 && errno == EINTR);
  -
  -    if (rc == -1) {
  -	/* XXX: uhh this could be really bad, we could have a bad file
  -	 * descriptor due to a bug in one of the maintenance routines */
  -	ap_log_unixerr("probe_writable_fds", "select",
  -		    "could not probe writable fds", server_conf);
  -	return;
  -    }
  -    if (rc == 0)
  -	return;
  -
  -    for (ocr = other_children; ocr; ocr = nocr) {
  -	nocr = ocr->next;
  -	if (ocr->write_fd == -1)
  -	    continue;
  -	if (FD_ISSET(ocr->write_fd, &writable_fds))
  -	    continue;
  -	(*ocr->maintenance) (OC_REASON_UNWRITABLE, ocr->data, -1);
  -    }
  -#endif
  -}
  -
  -/* possibly reap an other_child, return 0 if yes, -1 if not */
  -static int reap_other_child(int pid, ap_wait_t status)
  -{
  -    other_child_rec *ocr, *nocr;
  -
  -    for (ocr = other_children; ocr; ocr = nocr) {
  -	nocr = ocr->next;
  -	if (ocr->pid != pid)
  -	    continue;
  -	ocr->pid = -1;
  -	(*ocr->maintenance) (OC_REASON_DEATH, ocr->data, status);
  -	return 0;
  -    }
  -    return -1;
  -}
  -#endif
  -
   static void reclaim_child_processes(int terminate)
   {
       int i, status;
  @@ -300,9 +175,6 @@
       struct timeval tv;
       int waitret, tries;
       int not_dead_yet;
  -#ifdef HAS_OTHER_CHILD
  -    other_child_rec *ocr, *nocr;
  -#endif
   
       for (tries = terminate ? 4 : 1; tries <= 9; ++tries) {
   	/* don't want to hold up progress any more than 
  @@ -364,28 +236,7 @@
   		break;
   	    }
   	}
  -#ifdef HAS_OTHER_CHILD
  -	for (ocr = other_children; ocr; ocr = nocr) {
  -	    nocr = ocr->next;
  -	    if (ocr->pid == -1)
  -		continue;
  -
  -	    waitret = waitpid(ocr->pid, &status, WNOHANG);
  -	    if (waitret == ocr->pid) {
  -		ocr->pid = -1;
  -		(*ocr->maintenance) (OC_REASON_DEATH, ocr->data, status);
  -	    }
  -	    else if (waitret == 0) {
  -		(*ocr->maintenance) (OC_REASON_RESTART, ocr->data, -1);
  -		++not_dead_yet;
  -	    }
  -	    else if (waitret == -1) {
  -		/* uh what the heck? they didn't call unregister? */
  -		ocr->pid = -1;
  -		(*ocr->maintenance) (OC_REASON_LOST, ocr->data, -1);
  -	    }
  -	}
  -#endif
  +        ap_check_other_child();
   	if (!not_dead_yet) {
   	    /* nothing left to wait for */
   	    break;
  @@ -411,7 +262,7 @@
       ++wait_or_timeout_counter;
       if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
   	wait_or_timeout_counter = 0;
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	probe_writable_fds();
   #endif
       }
  @@ -999,7 +850,7 @@
   		    make_child(server_conf, child_slot, time(NULL));
   		    --remaining_children_to_start;
   		}
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	    }
   	    else if (reap_other_child(pid, status) == 0) {
   		/* handled */
  
  
  
  1.67      +2 -2      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.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- mpmt_pthread.c	2000/04/30 21:42:46	1.66
  +++ mpmt_pthread.c	2000/05/04 04:02:26	1.67
  @@ -279,7 +279,7 @@
       ++wait_or_timeout_counter;
       if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
   	wait_or_timeout_counter = 0;
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	probe_writable_fds();
   #endif
       }
  @@ -1133,7 +1133,7 @@
   		    make_child(server_conf, child_slot, time(NULL));
   		    --remaining_children_to_start;
   		}
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	    }
   	    else if (reap_other_child(pid, status) == 0) {
   		/* handled */
  
  
  
  1.81      +22 -16    apache-2.0/src/modules/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- prefork.c	2000/04/28 18:27:51	1.80
  +++ prefork.c	2000/05/04 04:02:29	1.81
  @@ -1014,12 +1014,14 @@
   }
   */
   
  -static int find_child_by_pid(int pid)
  +static int find_child_by_pid(ap_proc_t *pid)
   {
       int i;
  +    int actual_pid;
   
  +    ap_get_os_proc(&actual_pid, pid);
       for (i = 0; i < max_daemons_limit; ++i)
  -	if (ap_scoreboard_image->parent[i].pid == pid)
  +	if (ap_scoreboard_image->parent[i].pid == actual_pid)
   	    return i;
   
       return -1;
  @@ -1147,23 +1149,24 @@
   #endif
   static int wait_or_timeout_counter;
   
  -static int wait_or_timeout(ap_wait_t *status)
  +static ap_proc_t *wait_or_timeout(ap_wait_t *status, ap_pool_t *p)
   {
       struct timeval tv;
  -    int ret;
  +    ap_status_t rv;
  +    ap_proc_t *ret = NULL;
   
       ++wait_or_timeout_counter;
       if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
   	wait_or_timeout_counter = 0;
  -#ifdef HAS_OTHER_CHILD
  -	probe_writable_fds();
  +#ifdef APR_HAS_OTHER_CHILD
  +	ap_probe_writable_fds();
   #endif
       }
  -    ret = waitpid(-1, status, WNOHANG);
  -    if (ret == -1 && errno == EINTR) {
  -	return -1;
  +    rv = ap_wait_all_procs(&ret, WNOHANG, p);
  +    if (rv != -1 && rv == APR_CHILD_NOTDONE) {
  +	return NULL;
       }
  -    if (ret > 0) {
  +    if (rv == APR_CHILD_DONE) {
   	return ret;
       }
   #ifdef NEED_WAITPID
  @@ -1174,7 +1177,7 @@
       tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 1000000;
       tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 1000000;
       ap_select(0, NULL, NULL, NULL, &tv);
  -    return -1;
  +    return NULL;
   }
   
   /* handle all varieties of core dumping signals */
  @@ -1937,8 +1940,10 @@
   }
   
   
  -static void process_child_status(int pid, ap_wait_t status)
  +static void process_child_status(ap_proc_t *abs_pid, ap_wait_t status)
   {
  +    int pid;
  +    ap_get_os_proc(&pid, abs_pid);
       /* Child died... if it died due to a fatal error,
   	* we should simply bail out.
   	*/
  @@ -2096,13 +2101,14 @@
       while (!restart_pending && !shutdown_pending) {
   	int child_slot;
   	ap_wait_t status;
  -	int pid = wait_or_timeout(&status);
  +        /* this is a memory leak, but I'll fix it later. */
  +	ap_proc_t *pid = wait_or_timeout(&status, pconf);
   
   	/* XXX: if it takes longer than 1 second for all our children
   	 * to start up and get into IDLE state then we may spawn an
   	 * extra child
   	 */
  -	if (pid >= 0) {
  +	if (pid != NULL) {
   	    process_child_status(pid, status);
   	    /* non-fatal death... note that it's gone in the scoreboard. */
   	    ap_sync_scoreboard_image();
  @@ -2119,9 +2125,9 @@
   		    make_child(server_conf, child_slot, time(0));
   		    --remaining_children_to_start;
   		}
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	    }
  -	    else if (reap_other_child(pid, status) == 0) {
  +	    else if (ap_reap_other_child(pid, status) == 0) {
   		/* handled */
   #endif
   	    }
  
  
  
  1.35      +2 -124    apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c
  
  Index: spmt_os2.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- spmt_os2.c	2000/04/20 14:56:36	1.34
  +++ spmt_os2.c	2000/05/04 04:02:32	1.35
  @@ -115,19 +115,6 @@
   
   static int one_process = 0;
   
  -#ifdef HAS_OTHER_CHILD
  -/* used to maintain list of children which aren't part of the scoreboard */
  -typedef struct other_child_rec other_child_rec;
  -struct other_child_rec {
  -    other_child_rec *next;
  -    int pid;
  -    void (*maintenance) (int, void *, ap_wait_t);
  -    void *data;
  -    int write_fd;
  -};
  -static other_child_rec *other_children;
  -#endif
  -
   static ap_pool_t *pconf;		/* Pool for config stuff */
   static scoreboard *ap_scoreboard_image = NULL;
   
  @@ -243,115 +230,6 @@
   #define SAFE_ACCEPT(stmt) do {stmt;} while(0)
   #endif
   
  -
  -/*****************************************************************
  - * dealing with other children
  - */
  -
  -#ifdef HAS_OTHER_CHILD
  -API_EXPORT(void) ap_register_other_child(int pid,
  -		       void (*maintenance) (int reason, void *, ap_wait_t status),
  -			  void *data, int write_fd)
  -{
  -    other_child_rec *ocr;
  -
  -    ocr = ap_palloc(pconf, sizeof(*ocr));
  -    ocr->pid = pid;
  -    ocr->maintenance = maintenance;
  -    ocr->data = data;
  -    ocr->write_fd = write_fd;
  -    ocr->next = other_children;
  -    other_children = ocr;
  -}
  -
  -/* note that since this can be called by a maintenance function while we're
  - * scanning the other_children list, all scanners should protect themself
  - * by loading ocr->next before calling any maintenance function.
  - */
  -API_EXPORT(void) ap_unregister_other_child(void *data)
  -{
  -    other_child_rec **pocr, *nocr;
  -
  -    for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) {
  -	if ((*pocr)->data == data) {
  -	    nocr = (*pocr)->next;
  -	    (*(*pocr)->maintenance) (OC_REASON_UNREGISTER, (*pocr)->data, -1);
  -	    *pocr = nocr;
  -	    /* XXX: um, well we've just wasted some space in pconf ? */
  -	    return;
  -	}
  -    }
  -}
  -
  -/* test to ensure that the write_fds are all still writable, otherwise
  - * invoke the maintenance functions as appropriate */
  -static void probe_writable_fds(void)
  -{
  -    fd_set writable_fds;
  -    int fd_max;
  -    other_child_rec *ocr, *nocr;
  -    struct timeval tv;
  -    int rc;
  -
  -    if (other_children == NULL)
  -	return;
  -
  -    fd_max = 0;
  -    FD_ZERO(&writable_fds);
  -    do {
  -	for (ocr = other_children; ocr; ocr = ocr->next) {
  -	    if (ocr->write_fd == -1)
  -		continue;
  -	    FD_SET(ocr->write_fd, &writable_fds);
  -	    if (ocr->write_fd > fd_max) {
  -		fd_max = ocr->write_fd;
  -	    }
  -	}
  -	if (fd_max == 0)
  -	    return;
  -
  -	tv.tv_sec = 0;
  -	tv.tv_usec = 0;
  -	rc = ap_select(fd_max + 1, NULL, &writable_fds, NULL, &tv);
  -    } while (rc == -1 && errno == EINTR);
  -
  -    if (rc == -1) {
  -	/* XXX: uhh this could be really bad, we could have a bad file
  -	 * descriptor due to a bug in one of the maintenance routines */
  -	ap_log_unixerr("probe_writable_fds", "select",
  -		    "could not probe writable fds", server_conf);
  -	return;
  -    }
  -    if (rc == 0)
  -	return;
  -
  -    for (ocr = other_children; ocr; ocr = nocr) {
  -	nocr = ocr->next;
  -	if (ocr->write_fd == -1)
  -	    continue;
  -	if (FD_ISSET(ocr->write_fd, &writable_fds))
  -	    continue;
  -	(*ocr->maintenance) (OC_REASON_UNWRITABLE, ocr->data, -1);
  -    }
  -}
  -
  -/* possibly reap an other_child, return 0 if yes, -1 if not */
  -static int reap_other_child(int pid, ap_wait_t status)
  -{
  -    other_child_rec *ocr, *nocr;
  -
  -    for (ocr = other_children; ocr; ocr = nocr) {
  -	nocr = ocr->next;
  -	if (ocr->pid != pid)
  -	    continue;
  -	ocr->pid = -1;
  -	(*ocr->maintenance) (OC_REASON_DEATH, ocr->data, status);
  -	return 0;
  -    }
  -    return -1;
  -}
  -#endif
  -
   API_EXPORT(int) ap_exists_scoreboard_image(void)
   {
       return (ap_scoreboard_image ? 1 : 0);
  @@ -503,7 +381,7 @@
       ++wait_or_timeout_counter;
       if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
   	wait_or_timeout_counter = 0;
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   	probe_writable_fds();
   #endif
       }
  @@ -1483,7 +1361,7 @@
   		    make_child(server_conf, child_slot, time(0));
   		    --remaining_children_to_start;
   		}
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
   /* TODO: this won't work, we waited on a thread not a process
   	    }
   	    else if (reap_other_child(pid, status) == 0) {
  
  
  
  1.9       +2 -2      apache-2.0/src/modules/standard/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgid.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_cgid.c	2000/04/26 07:14:37	1.8
  +++ mod_cgid.c	2000/05/04 04:02:36	1.9
  @@ -299,7 +299,7 @@
   
   static void cgid_maint(int reason, void *data, ap_wait_t status)
   {
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
       int *sd = data;
       switch (reason) {
           case OC_REASON_DEATH:
  @@ -584,7 +584,7 @@
               cgid_server(main_server);
               exit(-1);
           } 
  -#ifdef HAS_OTHER_CHILD
  +#ifdef APR_HAS_OTHER_CHILD
           ap_register_other_child(pid, cgid_maint, &pid, -1);
   #endif
       } 
  
  
  
  1.6       +2 -1      apache-2.0/src/support/rotatelogs.c
  
  Index: rotatelogs.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/rotatelogs.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- rotatelogs.c	2000/04/27 04:22:57	1.5
  +++ rotatelogs.c	2000/05/04 04:02:37	1.6
  @@ -72,8 +72,9 @@
   #include <errno.h>
   #include <fcntl.h>
   #include <stdio.h>
  +#include <stdlib.h>
   
  -int main (int argc, char **argv)
  +int main (int argc, char *argv[])
   {
       char buf[BUFSIZE], buf2[MAX_PATH];
       time_t tLogEnd = 0;
  
  
  

Mime
View raw message