1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

libudev: conserve previous behavior

The commit dcfbde3a43 changes
sd_device_get_ifindex() returns -ENOENT instead of zero if the device
does not have ifindex.
Let's keep the original behavior of udev_device_get_ifindex().

Fixes #10699.
This commit is contained in:
Yu Watanabe 2018-11-11 23:33:17 +09:00
parent 5fb0720ebb
commit 8ecbc4b880

View File

@ -52,6 +52,8 @@ int udev_device_get_ifindex(struct udev_device *udev_device) {
assert(udev_device);
r = sd_device_get_ifindex(udev_device->device, &ifindex);
if (r == -ENOENT)
return 0;
if (r < 0)
return r;