Commit dc448af9 authored by sof's avatar sof
Browse files

[project @ 1999-03-01 08:57:57 by sof]

mingw32: Use C runtime's version of system()
parent 00752235
/* /*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * (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 * system Runtime Support
*/ */
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef HAVE_SYS_WAIT_H #ifndef mingw32_TARGET_OS
#include <sys/wait.h> # ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
# endif
#endif #endif
#ifdef HAVE_VFORK_H #ifdef HAVE_VFORK_H
...@@ -29,6 +31,15 @@ StgInt ...@@ -29,6 +31,15 @@ StgInt
systemCmd(cmd) systemCmd(cmd)
StgByteArray 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) #if defined(cygwin32_TARGET_OS)
/* The implementation of std. fork() has its problems /* The implementation of std. fork() has its problems
under cygwin32-b18, so we fall back on using libc's under cygwin32-b18, so we fall back on using libc's
...@@ -81,4 +92,5 @@ StgByteArray cmd; ...@@ -81,4 +92,5 @@ StgByteArray cmd;
} }
return -1; return -1;
#endif #endif
#endif
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment