diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-03-31 21:28:11 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2021-04-01 15:59:58 +0200 |
commit | 0f4b6e59bde9e150f07cdff0d5eabe5de959ff7b (patch) | |
tree | d9f841e60502048c361c00f5fe62601db7b9a254 /src/libudev | |
parent | Merge pull request #19168 from keszybz/nss-resolve-unfoobar (diff) | |
download | systemd-0f4b6e59bde9e150f07cdff0d5eabe5de959ff7b.tar.xz systemd-0f4b6e59bde9e150f07cdff0d5eabe5de959ff7b.zip |
libudev: fix return of udev_monitor_filter_add_match_subsystem_devtype()
Follow-up for 7117842657c0fc5a3446b6fe158615279cf2d650.
sd_device_monitor_filter_add_match_subsystem_devtype() now returns 1 to signify
that something was done, and 0 to signify that nothing was done, but
udev_monitor_filter_add_match_subsystem_devtype() needs to return 0 as documented.
udev_monitor_filter_add_match_tag() is adjusted to match.
This makes gdm start successfully here again.
Before, it would just not boot, with nothing very obvious in the logs:
gdm[1756]: Gdm: GdmDisplay: Session never registered, failing
Replaces #19171.
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-monitor.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index 4ddcf95d05..d7c931d9f9 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -265,9 +265,12 @@ _public_ struct udev_device *udev_monitor_receive_device(struct udev_monitor *ud * Returns: 0 on success, otherwise a negative error value. */ _public_ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype) { + int r; + assert_return(udev_monitor, -EINVAL); - return sd_device_monitor_filter_add_match_subsystem_devtype(udev_monitor->monitor, subsystem, devtype); + r = sd_device_monitor_filter_add_match_subsystem_devtype(udev_monitor->monitor, subsystem, devtype); + return r < 0 ? r : 0; } /** @@ -283,9 +286,12 @@ _public_ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor * Returns: 0 on success, otherwise a negative error value. */ _public_ int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag) { + int r; + assert_return(udev_monitor, -EINVAL); - return sd_device_monitor_filter_add_match_tag(udev_monitor->monitor, tag); + r = sd_device_monitor_filter_add_match_tag(udev_monitor->monitor, tag); + return r < 0 ? r : 0; } /** |