]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: rework how we handle the return value from spawned programs
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 6 Jan 2019 21:17:00 +0000 (22:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 7 Jan 2019 17:36:04 +0000 (18:36 +0100)
commita75211421fc9366068e6d9446e8e567246c72feb
tree071de5b28633006fccd0fb8e8b2b22fe17ae2560
parentf2e28b5a0d2cb67fc9778e7c787be0a02527afe7
udev: rework how we handle the return value from spawned programs

When running PROGRAM="...", we would log
systemd-udevd[447]: Failed to wait spawned command '...': Input/output error
no matter why the program actually failed, at error level.

The code wouldn't distinguish between an internal failure and a failure in the
program being called and run sd_event_exit(..., -EIO) on any kind of error. EIO
is rather misleading here, becuase it suggests a serious error.

on_spawn_sigchld is updated to set the return code to distinguish failure to
spawn, including the program being killed by a signal (a negative return value),
and the program failing (positive return value).

The logging levels are adjusted, so that for PROGRAM= calls, which are
essentially "if" statements, we only log at debug level (unless we get a
timeout or segfault or another unexpected error).
src/udev/udev-event.c
src/udev/udev-rules.c