You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2007/12/13 14:54:17 UTC

svn commit: r603921 - in /httpd/httpd/branches/2.0.x: STATUS server/log.c

Author: jim
Date: Thu Dec 13 05:54:16 2007
New Revision: 603921

URL: http://svn.apache.org/viewvc?rev=603921&view=rev
Log:
Merge r580437 from trunk:

Share a single write-pipe handle for piped stderr logging, this
prevents an extra logging process from hanging around after the
initial config-phase.

Reviewed by: rpluem, wrowe
Submitted by: wrowe
Reviewed by: jim

Modified:
    httpd/httpd/branches/2.0.x/STATUS
    httpd/httpd/branches/2.0.x/server/log.c

Modified: httpd/httpd/branches/2.0.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/STATUS?rev=603921&r1=603920&r2=603921&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/STATUS (original)
+++ httpd/httpd/branches/2.0.x/STATUS Thu Dec 13 05:54:16 2007
@@ -112,14 +112,6 @@
 
 RELEASE SHOWSTOPPERS:
 
-  * core log.c: Authored and Reviewed by both rplume and wrowe within 
-    the same 10 minutes, share only a single apr_file_t/fd between the
-    stderr and server_main->error_log to prevent any lingering write 
-    handles from hanging around in unexpected ways.
-       http://svn.apache.org/viewvc?view=rev&revision=580437
-     PR 43491, solution validated by reporter
-     +1: wrowe, rpluem, jim
-
   * core log.c: Work around possible solutions rejected by apr for
     the old implementation of apr_proc_create(), and explicitly pass
     the output and error channels to all log processes created.

Modified: httpd/httpd/branches/2.0.x/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/server/log.c?rev=603921&r1=603920&r2=603921&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/server/log.c (original)
+++ httpd/httpd/branches/2.0.x/server/log.c Thu Dec 13 05:54:16 2007
@@ -423,6 +423,16 @@
                 apr_pool_destroy(stderr_pool);
             stderr_pool = stderr_p;
             replace_stderr = 0;
+            /*
+             * Now that we have dup'ed s_main->error_log to stderr_log
+             * close it and set s_main->error_log to stderr_log. This avoids
+             * this fd being inherited by the next piped logger who would
+             * keep open the writing end of the pipe that this one uses
+             * as stdin. This in turn would prevent the piped logger from
+             * exiting.
+             */
+             apr_file_close(s_main->error_log);
+             s_main->error_log = stderr_log;
         }
     }
     /* note that stderr may still need to be replaced with something