Changes with Apache 1.3.23
+ *) Cause Win32 to capture all child-worker process errors in
+ Apache to the main server error log, until the child can
+ open it's own error logs. [William Rowe]
+
*) Revert mod_negotation's handling of path_info and query_args
to the 1.3.20 behavior. PR: 8628, 8582, 8538 [William Rowe]
HANDLE hPipeWrite = NULL;
HANDLE hPipeWriteDup;
HANDLE hNullOutput = NULL;
- HANDLE hNullError = NULL;
+ HANDLE hShareError = NULL;
HANDLE hCurrentProcess;
SECURITY_ATTRIBUTES sa = {0};
return -1;
}
- /* Open a null handle to soak info from the child */
- hNullError = CreateFile("nul", GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- &sa, OPEN_EXISTING, 0, NULL);
- if (hNullError == INVALID_HANDLE_VALUE) {
- ap_log_error(APLOG_MARK, APLOG_WIN32ERROR | APLOG_CRIT, server_conf,
- "Parent: Unable to create null error pipe for child process.\n");
- return -1;
+ /* Child's initial stderr -> our main server error log (or, failing that, stderr) */
+ if (server_conf->error_log) {
+ hShareError = (HANDLE)_get_osfhandle(fileno(server_conf->error_log));
+ if (hShareError == INVALID_HANDLE_VALUE) {
+ hShareError = GetStdHandle(STD_ERROR_HANDLE);
+ }
}
hCurrentProcess = GetCurrentProcess();
si.wShowWindow = SW_HIDE;
si.hStdInput = hPipeRead;
si.hStdOutput = hNullOutput;
- si.hStdError = hNullError;
+ si.hStdError = hShareError;
if (!CreateProcess(NULL, pCommand, NULL, NULL,
TRUE, /* Inherit handles */
CloseHandle(hPipeRead);
CloseHandle(hPipeWrite);
CloseHandle(hNullOutput);
- CloseHandle(hNullError);
return -1;
}
CloseHandle(hPipeRead);
CloseHandle(hPipeWrite);
CloseHandle(hNullOutput);
- CloseHandle(hNullError);
return 0;
}