Remove WNOWAIT code on linux.

Would cause os/proc-wait to block in some circumstances.
This commit is contained in:
Calvin Rose 2022-10-10 14:23:17 -05:00
parent 9dc03adfda
commit ab068cff67
1 changed files with 0 additions and 12 deletions

View File

@ -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;