Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 11187 invoked by uid 6000); 27 Jul 1999 13:46:11 -0000 Received: (qmail 11169 invoked by alias); 27 Jul 1999 13:46:08 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 11163 invoked by uid 215); 27 Jul 1999 13:46:07 -0000 Date: 27 Jul 1999 13:46:07 -0000 Message-ID: <19990727134607.11158.qmail@hyperreal.org> From: stoddard@hyperreal.org To: apache-1.3-cvs@hyperreal.org Subject: cvs commit: apache-1.3/src/main http_main.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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: Tim.Costello@bankerstrust.com.au 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;