]> granicus.if.org Git - apache/commitdiff
First step to get piped logs working on Windows (and Unix as well).
authorBill Stoddard <stoddard@apache.org>
Tue, 15 Feb 2000 00:54:06 +0000 (00:54 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 15 Feb 2000 00:54:06 +0000 (00:54 +0000)
There are still all kinds of problems in http_log.c. This patch just
barely scratches the surface.

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

server/log.c

index 0722ba36ebf1bb8f004273660e837672d440d5da..88b99f32f368157fb7fdb7ea845eecebd8d5ac5f 100644 (file)
@@ -176,12 +176,11 @@ static int log_child(ap_context_t *p, const char *progname,
     signal(SIGHUP, SIG_IGN);
 #endif /* ndef SIGHUP */
 
-    if ((ap_createprocattr_init(&procattr, p)          != APR_SUCCESS) ||
+    if ((ap_createprocattr_init(&procattr, p) != APR_SUCCESS) ||
         (ap_setprocattr_io(procattr,
-                           APR_NO_PIPE,
                            APR_FULL_BLOCK,
-                           APR_NO_PIPE) != APR_SUCCESS) ||
-        (ap_setprocattr_dir(procattr, progname)        != APR_SUCCESS)) {
+                           APR_NO_PIPE,
+                           APR_NO_PIPE) != APR_SUCCESS)) {
         /* Something bad happened, give up and go away. */
         rc = -1;
     }
@@ -264,15 +263,15 @@ void ap_open_logs(server_rec *s_main, ap_context_t *p)
 
     replace_stderr = 1;
     if (s_main->error_log) {
-       /* replace stderr with this new log */
-       fflush(stderr);
+        /* replace stderr with this new log */
+        fflush(stderr); /* ToDo: replace this with an APR call... */
         ap_open_stderr(&errfile, p);        
-       if (ap_dupfile(&errfile, s_main->error_log) != APR_SUCCESS) {
-           ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main,
-               "unable to replace stderr with error_log");
-       } else {
-           replace_stderr = 0;
-       }
+        if (ap_dupfile(&errfile, s_main->error_log) != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main,
+                         "unable to replace stderr with error_log");
+        } else {
+            replace_stderr = 0;
+        }
     }
     /* note that stderr may still need to be replaced with something
      * because it points to the old error log, or back to the tty