httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r467338 - in /httpd/httpd/trunk: CHANGES server/log.c
Date Tue, 24 Oct 2006 14:16:01 GMT
Author: jorton
Date: Tue Oct 24 07:16:01 2006
New Revision: 467338

URL: http://svn.apache.org/viewvc?view=rev&rev=467338
Log:
* server/log.c (ap_open_logs): When dup2'ing the error log to stderr,
use the already-open stderr file object rather than opening a new one.

Submitted by: Tom Donovan <Tom.Donovan acm.org>
PR: 40476

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/log.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=467338&r1=467337&r2=467338
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Oct 24 07:16:01 2006
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) Fix issue which could cause error messages to be written to access logs
+     on Win32.  PR 40476.  [Tom Donovan <Tom.Donovan acm.org>]
+
   *) The LockFile directive, which specifies the location of
      the accept() mutex lockfile, is depreciated. Instead, the
      AcceptMutex directive now takes an optional lockfile

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?view=diff&rev=467338&r1=467337&r2=467338
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Tue Oct 24 07:16:01 2006
@@ -354,10 +354,8 @@
 int ap_open_logs(apr_pool_t *pconf, apr_pool_t *p /* plog */,
                  apr_pool_t *ptemp, server_rec *s_main)
 {
-    apr_status_t rc = APR_SUCCESS;
     server_rec *virt, *q;
     int replace_stderr;
-    apr_file_t *errfile = NULL;
 
     apr_pool_cleanup_register(p, NULL, clear_handle_list,
                               apr_pool_cleanup_null);
@@ -367,13 +365,13 @@
 
     replace_stderr = 1;
     if (s_main->error_log) {
-        /* replace stderr with this new log */
+        apr_status_t rv;
+        
+        /* Replace existing stderr with new log. */
         apr_file_flush(s_main->error_log);
-        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,
+        rv = apr_file_dup2(stderr_log, s_main->error_log, p);
+        if (rv != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s_main,
                          "unable to replace stderr with error_log");
         }
         else {



Mime
View raw message