[project @ 2003-11-05 09:58:01 by simonmar]
[haskell-directory.git] / cbits / system.c
index 6c4e7f5..34a6f23 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * (c) The University of Glasgow 2002
  *
- * $Id: system.c,v 1.5 2002/02/07 11:13:30 simonmar Exp $
+ * $Id: system.c,v 1.8 2003/07/02 13:27:35 stolz Exp $
  *
  * system Runtime Support
  */
 #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 --------------------- */
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
     return system(cmd);
 #else
   /* -------------------- UNIX VERSION --------------------- */
@@ -29,7 +37,7 @@ systemCmd(HsAddr cmd)
 
     switch(pid = fork()) {
     case -1:
-       if (errno != EINTR) {
+       {
            return -1;
        }
     case 0: