From 2f3ae06e53eb8669354917d068aba9289b2d45e8 Mon Sep 17 00:00:00 2001 From: rrt Date: Tue, 7 Aug 2001 08:18:15 +0000 Subject: [PATCH] [project @ 2001-08-07 08:18:15 by rrt] Revert to shell-based method on Windows; the raw CreateProcess method is now in hslibs/lang/SystemExts. --- ghc/lib/std/cbits/system.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/ghc/lib/std/cbits/system.c b/ghc/lib/std/cbits/system.c index 5979630..d077323 100644 --- a/ghc/lib/std/cbits/system.c +++ b/ghc/lib/std/cbits/system.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: system.c,v 1.16 2001/06/29 11:40:48 simonpj Exp $ + * $Id: system.c,v 1.17 2001/08/07 08:18:15 rrt Exp $ * * system Runtime Support */ @@ -20,32 +20,8 @@ systemCmd(HsAddr cmd) { /* -------------------- WINDOWS VERSION --------------------- */ #if defined(mingw32_TARGET_OS) - STARTUPINFO sInfo; - PROCESS_INFORMATION pInfo; - DWORD retCode; - - sInfo.cb = sizeof(STARTUPINFO); - sInfo.lpReserved = NULL; - sInfo.lpReserved2 = NULL; - sInfo.cbReserved2 = 0; - sInfo.lpDesktop = NULL; - sInfo.lpTitle = NULL; - sInfo.dwFlags = 0; - - if (!CreateProcess(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &sInfo, &pInfo)) - /* The 'TRUE' says that the created process should share - handles with the current process. This is vital to ensure - that error messages sent to stderr actually appear on the screen. - Since we are going to wait for the process to terminate anyway, - there is no problem with such sharing. */ - - return -1; - WaitForSingleObject(pInfo.hProcess, INFINITE); - if (GetExitCodeProcess(pInfo.hProcess, &retCode) == 0) return -1; - CloseHandle(pInfo.hProcess); - CloseHandle(pInfo.hThread); - return retCode; - + if (system(cmd) < 0) return -1; + return 0; #else /* -------------------- UNIX VERSION --------------------- */ int pid; -- 1.7.10.4