[commit: process] master: Small cleanup of how we handle using fork vs vfork (0a0c107)

Ian Lynagh igloo at earth.li
Sat Apr 27 17:46:05 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/process

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0a0c107b03aad87f57c11f302a8a371401e12571

>---------------------------------------------------------------

commit 0a0c107b03aad87f57c11f302a8a371401e12571
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sat Apr 27 15:50:23 2013 +0100

    Small cleanup of how we handle using fork vs vfork

>---------------------------------------------------------------

 cbits/runProcess.c   |    2 +-
 include/runProcess.h |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/cbits/runProcess.c b/cbits/runProcess.c
index a315334..eed9638 100644
--- a/cbits/runProcess.c
+++ b/cbits/runProcess.c
@@ -85,7 +85,7 @@ runInteractiveProcess (char *const args[],
     // signal and keeps restarting indefinitely.
     stopTimer();
 
-    switch(pid = fork())
+    switch(pid = myfork())
     {
     case -1:
         unblockUserSignals();
diff --git a/include/runProcess.h b/include/runProcess.h
index 98b84f2..827e8d4 100644
--- a/include/runProcess.h
+++ b/include/runProcess.h
@@ -29,8 +29,12 @@
 #include <vfork.h>
 #endif
 
-#ifdef HAVE_VFORK
-#define fork vfork
+#if defined(HAVE_WORKING_VFORK)
+#define myfork vfork
+#elif defined(HAVE_WORKING_FORK)
+#define myfork fork
+#else
+#error Cannot find a working fork command
 #endif
 
 #ifdef HAVE_SIGNAL_H





More information about the ghc-commits mailing list