Created
November 14, 2011 14:25
-
-
Save bnoordhuis/1364050 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/unix/process.c b/src/unix/process.c | |
index c5a4592..59e1006 100644 | |
--- a/src/unix/process.c | |
+++ b/src/unix/process.c | |
@@ -156,9 +156,14 @@ static int uv__process_init_pipe(uv_pipe_t* handle, int fds[2], int flags) { | |
return uv__make_pipe(fds, flags); | |
} | |
+#ifndef HAVE_VFORK | |
+# define HAVE_VFORK 1 | |
+#endif | |
#ifndef SPAWN_WAIT_EXEC | |
-# define SPAWN_WAIT_EXEC 1 | |
+# if !HAVE_VFORK | |
+# define SPAWN_WAIT_EXEC 1 | |
+# endif | |
#endif | |
int uv_spawn(uv_loop_t* loop, uv_process_t* process, | |
@@ -224,7 +229,11 @@ int uv_spawn(uv_loop_t* loop, uv_process_t* process, | |
goto error; | |
#endif | |
+#if HAVE_VFORK | |
+ pid = vfork(); | |
+#else | |
pid = fork(); | |
+#endif | |
if (pid == -1) { | |
#if SPAWN_WAIT_EXEC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment