Fix qrexec transport reconnect: blocking waitpid for old child, sync nsigner_client.c with reconnect logic
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user