projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2004-06-29 19:10:47 by panne]
[ghc-base.git]
/
cbits
/
system.c
diff --git
a/cbits/system.c
b/cbits/system.c
index
805094f
..
34a6f23
100644
(file)
--- a/
cbits/system.c
+++ b/
cbits/system.c
@@
-1,7
+1,7
@@
/*
/*
- * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
+ * (c) The University of Glasgow 2002
*
*
- * $Id: system.c,v 1.3 2001/08/17 12:50:34 simonmar Exp $
+ * $Id: system.c,v 1.8 2003/07/02 13:27:35 stolz Exp $
*
* system Runtime Support
*/
*
* system Runtime Support
*/
@@
-9,19
+9,27
@@
/* The itimer stuff in this module is non-posix */
// #include "PosixSource.h"
/* The itimer stuff in this module is non-posix */
// #include "PosixSource.h"
-#include "HsCore.h"
+#include "HsBase.h"
#if defined(mingw32_TARGET_OS)
#include <windows.h>
#if defined(mingw32_TARGET_OS)
#include <windows.h>
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
+#endif
+
+#ifdef HAVE_VFORK
+#define fork vfork
#endif
HsInt
systemCmd(HsAddr cmd)
{
/* -------------------- WINDOWS VERSION --------------------- */
#endif
HsInt
systemCmd(HsAddr cmd)
{
/* -------------------- WINDOWS VERSION --------------------- */
-#if defined(mingw32_TARGET_OS)
- if (system(cmd) < 0) return -1;
- return 0;
+#if defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
+ return system(cmd);
#else
/* -------------------- UNIX VERSION --------------------- */
int pid;
#else
/* -------------------- UNIX VERSION --------------------- */
int pid;
@@
-29,7
+37,7
@@
systemCmd(HsAddr cmd)
switch(pid = fork()) {
case -1:
switch(pid = fork()) {
case -1:
- if (errno != EINTR) {
+ {
return -1;
}
case 0:
return -1;
}
case 0: