]> granicus.if.org Git - apache/commitdiff
Copying this code requires a (global) pool and rv declaration.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 6 Jan 2008 18:22:37 +0000 (18:22 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 6 Jan 2008 18:22:37 +0000 (18:22 +0000)
We don't need to replace this upon restart, so the global pool
is ideal, and ap_my_generation is a good test for this.

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

server/mpm/winnt/mpm_winnt.c

index 9ce90fbff5b58d8137e1cdcdf7f910f7a76a68be..04ffa508b7b8073086eec99a248f4c13f6fe5a68 100644 (file)
@@ -1372,21 +1372,23 @@ static int winnt_pre_config(apr_pool_t *pconf_, apr_pool_t *plog, apr_pool_t *pt
                      service_name);
         exit(APEXIT_INIT);
     }
-    else if (!one_process) {
+    else if (!one_process && !ap_my_generation) {
         /* Open a null handle to soak stdout in this process.
          * We need to emulate apr_proc_detach, unix performs this
          * same check in the pre_config hook (although it is
          * arguably premature).  Services already fixed this.
          */
         apr_file_t *nullfile;
+        apr_status_t rv;
+        apr_pool_t *pproc = apr_pool_parent_get(pconf);
 
         if ((rv = apr_file_open(&nullfile, "NUL",
                                 APR_READ | APR_WRITE, APR_OS_DEFAULT,
-                                process->pool)) == APR_SUCCESS) {
+                                pproc)) == APR_SUCCESS) {
             apr_file_t *nullstdout;
-            if (apr_file_open_stdout(&nullstdout, process->pool)
+            if (apr_file_open_stdout(&nullstdout, pproc)
                     == APR_SUCCESS)
-                apr_file_dup2(nullstdout, nullfile, process->pool);
+                apr_file_dup2(nullstdout, nullfile, pproc);
             apr_file_close(nullfile);
         }
     }