From: Gurusamy Sarathy Date: Mon, 22 Apr 2002 07:02:03 +0000 (+0000) Subject: another windows fix: only create a new console for subprocesses X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=139cf11b10fe82ec7be04ae7d145dc452057d38b;p=p5sagit%2Fp5-mst-13.2.git another windows fix: only create a new console for subprocesses when all three stdhandles are invalid (from Jan Dubois) p4raw-id: //depot/perl@16062 --- diff --git a/win32/win32.c b/win32/win32.c index 28619fd..ba8c637 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3727,14 +3727,14 @@ win32_spawnvp(int mode, const char *cmdname, const char *const *argv) StartupInfo.hStdInput = tbl.childStdIn; StartupInfo.hStdOutput = tbl.childStdOut; StartupInfo.hStdError = tbl.childStdErr; - if (StartupInfo.hStdInput != INVALID_HANDLE_VALUE && - StartupInfo.hStdOutput != INVALID_HANDLE_VALUE && - StartupInfo.hStdError != INVALID_HANDLE_VALUE) + if (StartupInfo.hStdInput == INVALID_HANDLE_VALUE && + StartupInfo.hStdOutput == INVALID_HANDLE_VALUE && + StartupInfo.hStdError == INVALID_HANDLE_VALUE) { - StartupInfo.dwFlags |= STARTF_USESTDHANDLES; + create |= CREATE_NEW_CONSOLE; } else { - create |= CREATE_NEW_CONSOLE; + StartupInfo.dwFlags |= STARTF_USESTDHANDLES; } if (w32_use_showwindow) { StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;