1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lws_spawn: get result to temp si

We pass the temp si to the reap callback, we delete the lsp one beforehand.
But we were collecting the spawn retcode into the lsp one...
This commit is contained in:
Andy Green 2020-03-18 12:20:41 +00:00
parent ed837acda0
commit c6165f8680

View file

@ -188,7 +188,7 @@ lws_spawn_reap(struct lws_spawn_piped *lsp)
}
temp = *lsp;
waitid(P_PID, lsp->child_pid, &lsp->si, WEXITED | WNOHANG);
waitid(P_PID, lsp->child_pid, &temp.si, WEXITED | WNOHANG);
lsp->child_pid = -1;
/* destroy the lsp itself first (it's freed and plsp set NULL */