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/08 14:59:22 UTC

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

Author: jim
Date: Sat Dec  8 05:59:22 2007
New Revision: 602467

URL: http://svn.apache.org/viewvc?rev=602467&view=rev
Log:
  * 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.
              This goes all the way back to piped logs failing to run on win32.
                  Not in or needed at trunk/, as apr 1.3.0 has the proper fix.


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

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=602467&r1=602466&r2=602467&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Sat Dec  8 05:59:22 2007
@@ -79,14 +79,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * 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.
-    This goes all the way back to piped logs failing to run on win32.
-    Not in or needed at trunk/, as apr 1.3.0 has the proper fix.
-      http://people.apache.org/~wrowe/httpd-2.0-2.2-procattr-bugfix-log.c.patch
-    +1: wrowe, rpluem, jim
-
   * mod_proxy_http: Correctly forward unexpected interim (HTTP 1xx) responses
     incorporating ap_send_interim_response core API
     PR 16518

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=602467&r1=602466&r2=602467&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/log.c (original)
+++ httpd/httpd/branches/2.2.x/server/log.c Sat Dec  8 05:59:22 2007
@@ -263,7 +263,7 @@
     apr_status_t rc;
     apr_procattr_t *procattr;
     apr_proc_t *procnew;
-    apr_file_t *errfile;
+    apr_file_t *outfile, *errfile;
 
     if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS)
         && ((rc = apr_procattr_cmdtype_set(procattr,
@@ -282,8 +282,11 @@
         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)
+        if ((rc = apr_file_open_stdout(&outfile, p)) == APR_SUCCESS) {
+            rc = apr_procattr_child_out_set(procattr, outfile, NULL);
+            if (dummy_stderr)
+                rc = apr_procattr_child_err_set(procattr, outfile, NULL);
+            else if ((rc = apr_file_open_stderr(&errfile, p)) == APR_SUCCESS)
                 rc = apr_procattr_child_err_set(procattr, errfile, NULL);
         }
 
@@ -887,6 +890,12 @@
     else {
         char **args;
         const char *pname;
+        apr_file_t *outfile, *errfile;
+
+        if ((status = apr_file_open_stdout(&outfile, pl->p)) == APR_SUCCESS)
+            status = apr_procattr_child_out_set(procattr, outfile, NULL);
+        if ((status = apr_file_open_stderr(&errfile, pl->p)) == APR_SUCCESS)
+            status = apr_procattr_child_err_set(procattr, errfile, NULL);
 
         apr_tokenize_to_argv(pl->program, &args, pl->p);
         pname = apr_pstrdup(pl->p, args[0]);