Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Created February 10, 2014 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FROGGS/601af1d005a0c1b13df5 to your computer and use it in GitHub Desktop.
Save FROGGS/601af1d005a0c1b13df5 to your computer and use it in GitHub Desktop.
diff --git a/src/6model/reprs/MVMOSHandle.c b/src/6model/reprs/MVMOSHandle.c
index 75d0858..61a0de8 100644
--- a/src/6model/reprs/MVMOSHandle.c
+++ b/src/6model/reprs/MVMOSHandle.c
@@ -1,5 +1,9 @@
#include "moar.h"
+#ifndef _WIN32
+#include <sys/wait.h>
+#endif
+
/* This representation's function pointer table. */
static const MVMREPROps this_repr;
@@ -62,7 +66,7 @@ static void gc_free(MVMThreadContext *tc, MVMObject *obj) {
#ifdef _WIN32
uv_process_close(tc->loop, handle->body.u.process);
#else
- waitpid(handle->body.u.process->pid);
+ waitpid(handle->body.u.process->pid, NULL, 0);
#endif
uv_unref((uv_handle_t *)handle->body.u.process);
uv_run(tc->loop, UV_RUN_DEFAULT);
diff --git a/src/io/fileops.c b/src/io/fileops.c
index 84f09a9..391d911 100644
--- a/src/io/fileops.c
+++ b/src/io/fileops.c
@@ -2,6 +2,7 @@
#include "platform/io.h"
#ifndef _WIN32
+#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#define DEFAULT_MODE 0x0FFF
@@ -294,7 +295,7 @@ void MVM_file_close_fh(MVMThreadContext *tc, MVMObject *oshandle) {
#ifdef _WIN32
uv_process_close(tc->loop, handle->body.u.process);
#else
- waitpid(handle->body.u.process->pid);
+ waitpid(handle->body.u.process->pid, NULL, 0);
#endif
uv_unref((uv_handle_t *)handle->body.u.process);
uv_run(tc->loop, UV_RUN_DEFAULT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment