Skip to content

Commit

Permalink
process: handle multiple calls to wait()
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Apr 2, 2024
1 parent 1bb7db5 commit 71316cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ static JSValue tjs_process_wait(JSContext *ctx, JSValueConst this_val, int argc,
p->status.term_signal == 0 ? JS_NULL : JS_NewString(ctx, tjs_getsig(p->status.term_signal));
JS_DefinePropertyValueStr(ctx, obj, "term_signal", term_signal, JS_PROP_C_W_E);
return TJS_NewResolvedPromise(ctx, 1, &obj);
} else if (!JS_IsUndefined(p->status.result.p)) {
return JS_DupValue(ctx, p->status.result.p);
} else {
return TJS_InitPromise(ctx, &p->status.result);
}
Expand Down

0 comments on commit 71316cf

Please sign in to comment.