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-12 13:00:30 +09:00
parent 5fb0720ebb
commit 8ecbc4b880
+2
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;