You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/01/04 19:22:51 UTC

cvs commit: httpd-2.0 libhttpd.def

trawick     01/01/04 10:22:51

  Modified:    include  http_log.h
               server   log.c main.c
               .        libhttpd.def
  Log:
  Set up stderr logging explictly early in initialization so that a pool is
  available for creating the APR representation of stderr.
  
  Revision  Changes    Path
  1.22      +6 -0      httpd-2.0/include/http_log.h
  
  Index: http_log.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_log.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- http_log.h	2000/10/19 00:04:55	1.21
  +++ http_log.h	2001/01/04 18:22:47	1.22
  @@ -114,6 +114,12 @@
   #define APLOG_MARK	__FILE__,__LINE__
   
   /**
  + * Set up for logging to stderr.
  + * @param p The pool to allocate out of
  + */
  +void ap_open_stderr_log(apr_pool_t *p);
  +
  +/**
    * Open the error log and replace stderr with it.
    * @param s_main The main server
    * @param p The pool to allocate out of
  
  
  
  1.78      +8 -1      httpd-2.0/server/log.c
  
  Index: log.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/log.c,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- log.c	2000/12/31 23:41:07	1.77
  +++ log.c	2001/01/04 18:22:49	1.78
  @@ -174,6 +174,13 @@
       {NULL,	-1},
   };
   
  +static apr_file_t *stderr_log;
  +
  +void ap_open_stderr_log(apr_pool_t *p)
  +{
  +    apr_open_stderr(&stderr_log, p);
  +}
  +
   static int log_child(apr_pool_t *p, const char *progname,
                        apr_file_t **fpin)
   {
  @@ -346,7 +353,7 @@
   	if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) &&
   	    ((level & APLOG_LEVELMASK) > DEFAULT_LOGLEVEL))
   	    return;
  -	apr_open_stderr(&logf, pool);
  +        logf = stderr_log;
       }
       else if (s->error_log) {
   	/*
  
  
  
  1.82      +5 -0      httpd-2.0/server/main.c
  
  Index: main.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/main.c,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- main.c	2001/01/01 00:36:46	1.81
  +++ main.c	2001/01/04 18:22:49	1.82
  @@ -214,12 +214,17 @@
   
       stat = apr_create_pool(&cntx, NULL);
       if (stat != APR_SUCCESS) {
  +        /* XXX From the time that we took away the NULL pool->malloc mapping
  +         *     we have been unable to log here without segfaulting.
  +         */
           ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
                        "apr_create_pool() failed to create "
                        "initial context");
           apr_terminate();
           exit(1);
       }
  +
  +    ap_open_stderr_log(cntx);
   
       process = apr_palloc(cntx, sizeof(process_rec));
       process->pool = cntx;
  
  
  
  1.48      +1 -0      httpd-2.0/libhttpd.def
  
  Index: libhttpd.def
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/libhttpd.def,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- libhttpd.def	2001/01/03 21:35:02	1.47
  +++ libhttpd.def	2001/01/04 18:22:50	1.48
  @@ -418,3 +418,4 @@
          ap_xml_insert_uri
   
          ap_os_create_privileged_process
  +       ap_open_stderr_log