stoddard 99/07/27 06:46:07
Modified: src/main http_main.c
Log:
Win32: Fix problem where Apache would not run if either the executable or the
configuration file has spaces in the path. Clean up a couple of handle leaks.
Thanks Tim!
Obtained from: [EMAIL PROTECTED]
Reviewed by: Bill Stoddard
Revision Changes Path
1.462 +5 -5 apache-1.3/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.461
retrieving revision 1.462
diff -u -r1.461 -r1.462
--- http_main.c 1999/07/26 09:26:07 1.461
+++ http_main.c 1999/07/27 13:46:05 1.462
@@ -5785,7 +5785,7 @@
return -1;
}
- pCommand = ap_psprintf(p, "%s -Z %s -f %s", buf, exit_event_name,
ap_server_confname);
+ pCommand = ap_psprintf(p, "\"%s\" -Z %s -f \"%s\"", buf,
exit_event_name, ap_server_confname);
for (i = 1; i < argc; i++) {
pCommand = ap_pstrcat(p, pCommand, " ", argv[i], NULL);
@@ -5807,10 +5807,6 @@
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.wShowWindow = SW_HIDE;
si.hStdInput = hPipeRead;
- /*
- si.hStdOutput = NULL;
- si.hStdError = NULL;
- */
if (!CreateProcess(NULL, pCommand, NULL, NULL,
TRUE, /* Inherit handles */
@@ -5837,6 +5833,9 @@
events[*processes] = kill_event;
(*processes)++;
+ /* We never store the thread's handle, so close it now. */
+ CloseHandle(pi.hThread);
+
/* Run the chain of open sockets. For each socket, duplicate it
* for the target process then send the WSAPROTOCOL_INFO
* (returned by dup socket) to the child */
@@ -5866,6 +5865,7 @@
break;
}
}
+ CloseHandle(hPipeRead);
CloseHandle(hPipeWrite);
return 0;