--- server\mpm\winnt\mpm_winnt.c_orig 2007-12-31 00:41:06.000000000 -0500 +++ server\mpm\winnt\mpm_winnt.c 2008-01-05 21:26:08.653332500 -0500 @@ -680,12 +680,11 @@ } /* httpd-2.0/2.2 specific to work around apr_proc_create bugs */ - if (((rv = apr_file_open_stdout(&child_out, p)) - != APR_SUCCESS) || - ((rv = apr_procattr_child_out_set(attr, child_out, NULL)) - != APR_SUCCESS)) { - ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, - "Parent: Could not set child process stdout"); + /* Always pass a "NUL" stdout to child process */ + if (apr_file_open(&child_out, "NUL", APR_READ | APR_WRITE, APR_OS_DEFAULT, ptemp) + || apr_procattr_child_out_set(attr, child_out, NULL) ) { + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, + "Parent: Could not set child process stdout to NUL"); } if (((rv = apr_file_open_stderr(&child_err, p)) != APR_SUCCESS) || @@ -1285,8 +1284,6 @@ */ if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) { - apr_file_t *nullfile; - if (!errout) { mpm_nt_eventlog_stderr_open(service_name, process->pool); } @@ -1295,21 +1292,6 @@ if (service_to_start_success == APR_SUCCESS) { service_set = APR_SUCCESS; } - - /* Open a null handle to soak stdout in this process. - * Windows service processes are missing any file handle - * usable for stdin/out/err. This was the cause of later - * trouble with invocations of apr_file_open_stdout() - */ - if ((rv = apr_file_open(&nullfile, "NUL", - APR_READ | APR_WRITE, APR_OS_DEFAULT, - process->pool)) == APR_SUCCESS) { - apr_file_t *nullstdout; - if (apr_file_open_stdout(&nullstdout, process->pool) - == APR_SUCCESS) - apr_file_dup2(nullstdout, nullfile, process->pool); - apr_file_close(nullfile); - } } }