httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r609715 - in /httpd/httpd/branches/2.0.x: CHANGES server/mpm/winnt/mpm_winnt.c
Date Mon, 07 Jan 2008 17:36:27 GMT
Author: wrowe
Date: Mon Jan  7 09:36:25 2008
New Revision: 609715

URL: http://svn.apache.org/viewvc?rev=609715&view=rev
Log:
winnt_mpm: Resolve modperl issues by redirecting console mode stdout
to /Device/Nul as the server is starting up, mirroring unix MPM's.

PR: 43534

Submitted by: Tom Donovan <Tom.Donovan acm.org> and William Rowe

Backports: r609354, r609366

Modified:
    httpd/httpd/branches/2.0.x/CHANGES
    httpd/httpd/branches/2.0.x/server/mpm/winnt/mpm_winnt.c

Modified: httpd/httpd/branches/2.0.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/CHANGES?rev=609715&r1=609714&r2=609715&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.0.x/CHANGES [utf-8] Mon Jan  7 09:36:25 2008
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.0.63
 
+  *) winnt_mpm: Resolve modperl issues by redirecting console mode stdout
+     to /Device/Nul as the server is starting up, mirroring unix MPM's.
+     PR: 43534  [Tom Donovan <Tom.Donovan acm.org>, William Rowe]
+
   *) winnt_mpm: Restore Win32DisableAcceptEx On directive and Win9x platform
      by recreating the bucket allocator each time the trans pool is cleared.
      PR: 11427 #16 (follow-on)  [Tom Donovan <Tom.Donovan acm.org>]

Modified: httpd/httpd/branches/2.0.x/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/server/mpm/winnt/mpm_winnt.c?rev=609715&r1=609714&r2=609715&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/branches/2.0.x/server/mpm/winnt/mpm_winnt.c Mon Jan  7 09:36:25 2008
@@ -1405,6 +1405,26 @@
                      service_name);
         exit(APEXIT_INIT);
     }
+    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,
+                                pproc)) == APR_SUCCESS) {
+            apr_file_t *nullstdout;
+            if (apr_file_open_stdout(&nullstdout, pproc)
+                    == APR_SUCCESS)
+                apr_file_dup2(nullstdout, nullfile, pproc);
+            apr_file_close(nullfile);
+        }
+    }
 
     /* Win9x: disable AcceptEx */
     if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {



Mime
View raw message