From 2553c5f94a5d51c2c5876b31e4c1521ad9be12f6 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 8 Dec 2020 09:29:09 +1300 Subject: Add support for non-blocking `Process.wait`. --- io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 0182042b39..b5553b5783 100644 --- a/io.c +++ b/io.c @@ -4913,9 +4913,9 @@ fptr_waitpid(rb_io_t *fptr, int nohang) { int status; if (fptr->pid) { - rb_last_status_clear(); - rb_waitpid(fptr->pid, &status, nohang ? WNOHANG : 0); - fptr->pid = 0; + rb_last_status_clear(); + rb_waitpid(fptr->pid, &status, nohang ? WNOHANG : 0); + fptr->pid = 0; } } @@ -6433,11 +6433,11 @@ pipe_finalize(rb_io_t *fptr, int noraise) #if !defined(HAVE_WORKING_FORK) && !defined(_WIN32) int status = 0; if (fptr->stdio_file) { - status = pclose(fptr->stdio_file); + status = pclose(fptr->stdio_file); } fptr->fd = -1; fptr->stdio_file = 0; - rb_last_status_set(status, fptr->pid); + rb_last_status_set(fptr->pid, status, 0); #else fptr_finalize(fptr, noraise); #endif -- cgit v1.2.3