Fix qrexec transport reconnect: blocking waitpid for old child, sync nsigner_client.c with reconnect logic

This commit is contained in:
Laan Tungir
2026-07-28 06:31:43 -04:00
parent 6ebab823a8
commit 27da465295
+4 -2
View File
@@ -402,10 +402,11 @@ static int nsigner_fd_reconnect_qrexec(nsigner_fd_transport_ctx_t* ctx) {
return -1;
}
/* Reap any previous child */
/* Reap any previous child — blocking wait. The parent nsigner_fd_reconnect
* already closed the old fds, so the child should have exited. */
if (ctx->qrexec_pid > 0) {
int status;
(void)waitpid(ctx->qrexec_pid, &status, WNOHANG);
(void)waitpid(ctx->qrexec_pid, &status, 0);
ctx->qrexec_pid = 0;
}
@@ -471,6 +472,7 @@ static int nsigner_fd_reconnect(nsigner_transport_t* t) {
return -1;
}
ctx = (nsigner_fd_transport_ctx_t*)t->ctx;
/* Close any existing fds first. */