diff --git a/nostr_core/nsigner_transport.c b/nostr_core/nsigner_transport.c index df37ce6c..37ada831 100644 --- a/nostr_core/nsigner_transport.c +++ b/nostr_core/nsigner_transport.c @@ -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. */