From d83f5766b84b12016e15024b48f83a094266845a Mon Sep 17 00:00:00 2001 From: burlex Date: Sat, 9 Jun 2007 23:20:42 +0000 Subject: - Removed un-needed event create at windows fork. * Fixed command line arguments when using fork under windows. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7266 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 43045f876..dee4ece10 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -50,7 +50,11 @@ DWORD WindowsForkStart(InspIRCd * Instance) // Build the command line arguments. string command_line; for(int i = 0; i < Instance->Config->argc; ++i) + { command_line += Instance->Config->argv[i]; + if(Instance->Config->argc != i+1) + command_line += " "; + } char module[MAX_PATH]; if(!GetModuleFileName(NULL, module, MAX_PATH)) @@ -64,13 +68,8 @@ DWORD WindowsForkStart(InspIRCd * Instance) // Fill in the startup info struct GetStartupInfo(&startupinfo); - // Create the "startup" event - HANDLE fork_event = CreateEvent(0, TRUE, FALSE, "InspStartup"); - if(!fork_event) - return false; - // Launch our "forked" process. - BOOL bSuccess = CreateProcess ( module, NULL, + BOOL bSuccess = CreateProcess ( module, (LPTSTR)command_line.c_str(), 0, // PROCESS_SECURITY_ATTRIBUTES 0, // THREAD_SECURITY_ATTRIBUTES TRUE, // We went to inherit handles. -- cgit v1.2.3