From c6165f8680f33f9635e722ef5470cf05e50729ea Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 18 Mar 2020 12:20:41 +0000 Subject: [PATCH] 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... --- lib/misc/spawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc/spawn.c b/lib/misc/spawn.c index d219a1177..e8ce6dffd 100644 --- a/lib/misc/spawn.c +++ b/lib/misc/spawn.c @@ -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 */