From: sof Date: Mon, 1 Mar 1999 08:57:57 +0000 (+0000) Subject: [project @ 1999-03-01 08:57:57 by sof] X-Git-Tag: Approximately_9120_patches~6497 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=dc448af905daadb38b64f1fc6b2ddf473f8a0bab;p=ghc-hetmet.git [project @ 1999-03-01 08:57:57 by sof] mingw32: Use C runtime's version of system() --- diff --git a/ghc/lib/std/cbits/system.c b/ghc/lib/std/cbits/system.c index 41bafd3..2349ea7 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.4 1999/01/07 15:42:33 simonm Exp $ + * $Id: system.c,v 1.5 1999/03/01 08:57:57 sof Exp $ * * system Runtime Support */ @@ -13,8 +13,10 @@ #include #endif -#ifdef HAVE_SYS_WAIT_H -#include +#ifndef mingw32_TARGET_OS +# ifdef HAVE_SYS_WAIT_H +# include +# endif #endif #ifdef HAVE_VFORK_H @@ -29,6 +31,15 @@ StgInt systemCmd(cmd) StgByteArray cmd; { +#if defined(mingw32_TARGET_OS) + if (system(cmd) < 0) { + cvtErrno(); + stdErrno(); + return -1; + } + sleep(1); + return 0; +#else #if defined(cygwin32_TARGET_OS) /* The implementation of std. fork() has its problems under cygwin32-b18, so we fall back on using libc's @@ -81,4 +92,5 @@ StgByteArray cmd; } return -1; #endif +#endif }