[Rpm-maint] [rpm-software-management/rpm] Fix ignoring exit code of child scripts in case of EINTR (PR #2398)
Коренберг Марк
notifications at github.com
Tue Mar 7 15:42:30 UTC 2023
@socketpair 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
Fixed
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2398#discussion_r1128077353
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2398/review/1328856231 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230307/7763c555/attachment-0001.html>
More information about the Rpm-maint
mailing list