]> granicus.if.org Git - apache/commitdiff
Share a single write-pipe handle for piped stderr logging, this
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 28 Sep 2007 17:43:24 +0000 (17:43 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 28 Sep 2007 17:43:24 +0000 (17:43 +0000)
prevents an extra logging process from hanging around after the
initial config-phase.

Reviewed by: rpluem, wrowe

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580437 13f79535-47bb-0310-9956-ffa450edef68

server/log.c

index 14b4fdc21f1d988f8b2a5e40c6a1eb451769ba24..aa840abfd90c197d2330220e5e24c46152d77c8f 100644 (file)
@@ -421,6 +421,16 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *p /* plog */,
                 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