Skip to content

If execvp() fails, log an error message and exit with error status - #6

Merged
Plagman merged 2 commits into
Plagman:mainfrom
smcv:execvp-can-fail
Oct 16, 2026
Merged

Plagman merged 2 commits into
Plagman:mainfrom
smcv:execvp-can-fail

Conversation

@smcv

@smcv smcv commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Before:

$ ./_build/reaper -- /nonexistent; echo status=$?
status=0
$ ./_build/reaper -- /dev/null; echo status=$?
status=0

After:

$ ./_build/reaper -- /nonexistent; echo status=$?
reaper: execvp(/nonexistent) failed: No such file or directory
status=1
$ ./_build/reaper -- /dev/null; echo status=$? 
reaper: execvp(/dev/null) failed: Permission denied
status=1

alkazar and others added 2 commits October 16, 2026 11:41
On success, `execvp()` does not return, but on failure it can.
Previously, the child process would have fallen through to waiting
for its own child processes (in practice it would not have any)
and then exiting with status 0.

Related to ValveSoftware/steam-for-linux#13520

Resolves: Plagman#4
Signed-off-by: Simon McVittie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exec failure not diagnosed

3 participants