From ab068cff67c9e7a0dfd2af7b5dba26002cdea51f Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 10 Oct 2022 14:23:17 -0500 Subject: [PATCH] Remove WNOWAIT code on linux. Would cause os/proc-wait to block in some circumstances. --- src/core/os.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/core/os.c b/src/core/os.c index 4cde4c2a..ab463a1e 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -470,15 +470,7 @@ static int proc_get_status(JanetProc *proc) { /* Function that is called in separate thread to wait on a pid */ static JanetEVGenericMessage janet_proc_wait_subr(JanetEVGenericMessage args) { JanetProc *proc = (JanetProc *) args.argp; -#ifdef WNOWAIT - pid_t result; - int status = 0; - do { - result = waitpid(proc->pid, &status, WNOWAIT); - } while (result == -1 && errno == EINTR); -#else args.tag = proc_get_status(proc); -#endif return args; } @@ -489,11 +481,7 @@ static void janet_proc_wait_cb(JanetEVGenericMessage args) { janet_ev_dec_refcount(); JanetProc *proc = (JanetProc *) args.argp; if (NULL != proc) { -#ifdef WNOWAIT - int status = proc_get_status(proc); -#else int status = args.tag; -#endif proc->return_code = (int32_t) status; proc->flags |= JANET_PROC_WAITED; proc->flags &= ~JANET_PROC_WAITING;