httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server log.c
Date Tue, 12 Feb 2002 00:11:34 GMT
wrowe       02/02/11 16:11:34

  Modified:    server   log.c
  Log:
    This code seriously misassumed (and may yet) that stderr was a valid file.
    It also has some bogus non-apr code that probably does great evil to win32
    services.  This must be bumped into .32, code review is incomplete still.
  
  Revision  Changes    Path
  1.107     +5 -3      httpd-2.0/server/log.c
  
  Index: log.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/log.c,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- log.c	6 Feb 2002 21:13:28 -0000	1.106
  +++ log.c	12 Feb 2002 00:11:34 -0000	1.107
  @@ -179,7 +179,7 @@
       {NULL,      -1},
   };
   
  -static apr_file_t *stderr_log;
  +static apr_file_t *stderr_log = NULL;
   
   AP_DECLARE(void) ap_open_stderr_log(apr_pool_t *p)
   {
  @@ -294,8 +294,9 @@
       if (s_main->error_log) {
           /* replace stderr with this new log */
           apr_file_flush(s_main->error_log);
  -        apr_file_open_stderr(&errfile, p);        
  -        rc = apr_file_dup2(errfile, s_main->error_log, p);
  +        if ((rc = apr_file_open_stderr(&errfile, p)) == APR_SUCCESS) {
  +            rc = apr_file_dup2(errfile, s_main->error_log, p);
  +        }
           if (rc != APR_SUCCESS) {
               ap_log_error(APLOG_MARK, APLOG_CRIT, rc, s_main,
                            "unable to replace stderr with error_log");
  @@ -306,6 +307,7 @@
       /* note that stderr may still need to be replaced with something
        * because it points to the old error log, or back to the tty
        * of the submitter.
  +     * XXX: This is BS - /dev/null is non-portable
        */
       if (replace_stderr && freopen("/dev/null", "w", stderr) == NULL) {
           ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main,
  
  
  

Mime
View raw message