Skip to content

Commit

Permalink
fake POSIX exit codes consequently on windows
Browse files Browse the repository at this point in the history
We faked these before when the invoked command already had shut down, now
we also do the right thing when we explicitly close it.
  • Loading branch information
FROGGS committed Apr 17, 2015
1 parent ab4bb38 commit ed6acb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/io/syncpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static MVMint64 do_close(MVMThreadContext *tc, MVMIOSyncPipeData *data) {
if (!uv_is_closing((uv_handle_t*)data->process))
uv_process_close(tc->loop, data->process);
GetExitCodeProcess(data->process->process_handle, &status);
status = status << 8;
#else
waitpid(data->process->pid, &status, 0);
#endif
Expand All @@ -52,7 +53,7 @@ static MVMint64 do_close(MVMThreadContext *tc, MVMIOSyncPipeData *data) {
MVM_string_decodestream_destory(tc, data->ss.ds);
data->ss.ds = NULL;
}
return status;
return (MVMint64)status;
}
static MVMint64 closefh(MVMThreadContext *tc, MVMOSHandle *h) {
MVMIOSyncPipeData *data = (MVMIOSyncPipeData *)h->body.data;
Expand Down

0 comments on commit ed6acb2

Please sign in to comment.