[Rpm-maint] [rpm-software-management/rpm] Fix ignoring exit code of child scripts in case of EINTR (PR #2398)

Panu Matilainen notifications at github.com
Tue Mar 7 12:14:08 UTC 2023


@pmatilai commented on this pull request.



> @@ -402,7 +402,19 @@ static int getOutputFrom(ARGV_t argv,
 
 reap:
     /* Collect status from prog */
-    reaped = waitpid(child, &status, 0);
+
+    do {
+	reaped = waitpid(child, &status, 0);
+    } while (reaped == -1 && errno == EINTR);
+
+    // It's not allowed to call WIFEXITED or WEXITSTATUS if waitpid return -1.
+    // Note, all bits set, since -1 == 0xFFFFFFFF

See https://github.com/rpm-software-management/rpm/blob/master/CONTRIBUTING.md#comments for comment style.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2398#pullrequestreview-1328280833
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2398/review/1328280833 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230307/83ffa38f/attachment.html>


More information about the Rpm-maint mailing list