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)
committerMichael Biebl <biebl@debian.org>
Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)
commit8f16e5b3f01af2b2f76b0deb2c982be3c1067d74
tree58a36bfcb6663af69c77660abc396113082c6d5a
parentffd30ab1b7a0db29c82926423cfc66999ff0ee55
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).

(cherry picked from commit a75211421fc9366068e6d9446e8e567246c72feb)
(cherry picked from commit 5862f1730af205e2b95349b477aeed25b2f3e3b8)

Gbp-Pq: Name udev-rework-how-we-handle-the-return-value-from-spawned-p.patch
src/udev/udev-event.c
src/udev/udev-rules.c