You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2007/08/25 00:05:55 UTC

svn commit: r569542 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS server/log.c

Author: wrowe
Date: Fri Aug 24 15:05:55 2007
New Revision: 569542

URL: http://svn.apache.org/viewvc?rev=569542&view=rev
Log:
log core: fix the new piped logger case where we couldn't connect 
the replacement stderr logger's stderr to the NULL stdout stream.  
Continue in this case, since the previous alternative of no error 
logging at all (/dev/null) is far worse. [William Rowe]

also disambiguate an error message to diagnose future error reports

Backport: r568326, r568322

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/server/log.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=569542&r1=569541&r2=569542&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Fri Aug 24 15:05:55 2007
@@ -1,6 +1,11 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.6
 
+  *) log core: fix the new piped logger case where we couldn't connect 
+     the replacement stderr logger's stderr to the NULL stdout stream.  
+     Continue in this case, since the previous alternative of no error 
+     logging at all (/dev/null) is far worse. [William Rowe]
+
   *) mpm_winnt: Prevent the parent-child pipe from leaking into other
      spawned processes, and ensure we have a /Device/null handle for
      stdout when running as-a-service.  [William Rowe]

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=569542&r1=569541&r2=569542&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Fri Aug 24 15:05:55 2007
@@ -290,17 +290,6 @@
       http://svn.apache.org/viewvc?view=rev&revision=565671
       +1: niq
  
-    * log core: fix the new piped logger case where we couldn't connect 
-      the replacement stderr logger's stderr to the NULL stdout stream.  
-      Continue in this case, since the previous alternative of no error 
-      logging at all (/dev/null) is far worse. [William Rowe]
-        http://svn.apache.org/viewvc?view=rev&revision=568326
-      disambiguate an error message to diagnose future error reports
-        http://svn.apache.org/viewvc?view=rev&revision=568322
-        +1: wrowe
-            rpluem says: +1 once r568446 is backported.
-            jim: Agrees with rpluem.
-
     * main core: Emit errors during the initial apr_app_initialize()
       or apr_pool_create() (when apr-based error reporting is not ready).
         http://svn.apache.org/viewvc?view=rev&revision=568779

Modified: httpd/httpd/branches/2.2.x/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/log.c?rev=569542&r1=569541&r2=569542&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/log.c (original)
+++ httpd/httpd/branches/2.2.x/server/log.c Fri Aug 24 15:05:55 2007
@@ -213,7 +213,7 @@
     }
     if (rc != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rc, NULL,
-                     "unable to replace stderr with error_log");
+                     "unable to replace stderr with error log file");
     }
     return rc;
 }
@@ -250,18 +250,20 @@
                                       APR_NO_PIPE,
                                       APR_NO_PIPE)) == APR_SUCCESS)
         && ((rc = apr_procattr_error_check_set(procattr, 1)) == APR_SUCCESS)
-        && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) == APR_SUCCESS)
-        && (!dummy_stderr 
-            || ((rc = apr_file_open_stdout(&errfile, p)) == APR_SUCCESS
-                && (rc = apr_procattr_child_err_set(procattr, 
-                                                    errfile, 
-                                                    errfile)) == APR_SUCCESS))) {
+        && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) 
+                == APR_SUCCESS)) {
         char **args;
         const char *pname;
 
         apr_tokenize_to_argv(progname, &args, p);
         pname = apr_pstrdup(p, args[0]);
         procnew = (apr_proc_t *)apr_pcalloc(p, sizeof(*procnew));
+
+        if (dummy_stderr) {
+            if ((rc = apr_file_open_stdout(&errfile, p)) == APR_SUCCESS)
+                rc = apr_procattr_child_err_set(procattr, errfile, NULL);
+        }
+
         rc = apr_proc_create(procnew, pname, (const char * const *)args,
                              NULL, procattr, p);
 
@@ -271,13 +273,6 @@
             /* read handle to pipe not kept open, so no need to call
              * close_handle_in_child()
              */
-        }
-
-        /* apr_procattr_child_err_set dups errfile twice: close the
-         * remaining "parent-side" copy (apr_proc_create closes the
-         * other). */
-        if (dummy_stderr) {
-            apr_file_close(procnew->err);
         }
     }