dmnks commented on this pull request.


> @@ -276,7 +282,26 @@ static int runGPG(sigTarget sigt, const char *sigfile)
     rpmPopMacro(NULL, "__plaintext_filename");
     rpmPopMacro(NULL, "__signature_filename");
 
+    /* The child GPG process may terminate without ever opening the pipe (such
+     * as when the key is expired), causing our parent process to get forever
+     * stuck on the Fopen() call below (see fifo(7) for details).  To fix that,
+     * we need to let the underlying open(2) unblock when SIGCHLD is received,
+     * by registering a no-op handler, so here we go: */
+    struct sigaction act;
+    memset(&act, '\0', sizeof(act));
+    act.sa_handler = &gpg_sa_handler;
+    act.sa_flags = 0;  /* Make sure we don't have SA_RESTART */
+    sigaction(SIGCHLD, &act, NULL);

Oh, restoring the handler is something that I just didn't realize at all. 
Thanks for that.

Yeah, it really is superfluous :) I wanted to signify that `SA_RESTART` is not 
set, but since we `memset()` the whole struct right above, it's really not 
needed and I'll remove it as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/938#discussion_r347250293
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to