Fix regression in Lua scriptlet runaway child detection #2818
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix regression in Lua scriptlet runaway child detection
Commit a810765 moved the detection to parent using waitpid(), but this causes it to complain on any process in the same process group. In the usual rpm context we don't have any, but we can't very well tell API users not to have any children. And then failed to detect a runaway Lua child in one of our own tests. Uff.
rpmlog() in the child has the issues mentioned in the originating commit, but that's a problem that needs to be solved elsewhere. Revert back to issuing a warning when we actually are in the child process, so there are no false positive possible. Use EXIT_FAILURE like in the original version, dunno why I'd changed that.
Update the rpmlua test to expect the deserved warning, and use stdio for printing its "normal" output, the catch there is that we need to flush the io in the child.
Reported at https://bugzilla.redhat.com/show_bug.cgi?id=2254463