Skip to content

Commit

Permalink
spawn: on OSX only waitpid can get return code
Browse files Browse the repository at this point in the history
  • Loading branch information
lws-team committed Mar 24, 2020
1 parent 6440521 commit c261f5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/misc/spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ lws_spawn_reap(struct lws_spawn_piped *lsp)
}

temp = *lsp;
waitid(P_PID, lsp->child_pid, &temp.si, WEXITED | WNOHANG);
n = waitid(P_PID, lsp->child_pid, &temp.si, WEXITED | WNOHANG);
temp.si.si_status &= 0xff; /* we use b8 + for flags */
lwsl_notice("%s: waitd says %d, process exit %d\n",
__func__, n, temp.si.si_status);

lsp->child_pid = -1;

/* destroy the lsp itself first (it's freed and plsp set NULL */
Expand Down

0 comments on commit c261f5a

Please sign in to comment.