chiark / gitweb /
Revert "networkd: don't assume udev_device_new_from_device_id sets errno"
authorTom Gundersen <teg@jklm.no>
Thu, 31 Jul 2014 13:26:20 +0000 (15:26 +0200)
committerTom Gundersen <teg@jklm.no>
Fri, 1 Aug 2014 09:56:13 +0000 (11:56 +0200)
libudev now does set errno correctly, so we can indeed rely on this.

This reverts commit 2b49732c3d511007ae2c413997e56c40f678d79a.

src/network/networkd-link.c

index 5b1376a..ec1a97a 100644 (file)
@@ -2146,8 +2146,8 @@ int link_add(Manager *m, sd_rtnl_message *message, Link **ret) {
                 sprintf(ifindex_str, "n%d", link->ifindex);
                 device = udev_device_new_from_device_id(m->udev, ifindex_str);
                 if (!device) {
-                        log_warning_link(link, "could not find udev device");
-                        return -ENOENT;
+                        log_warning_link(link, "could not find udev device: %m");
+                        return -errno;
                 }
 
                 if (udev_device_get_is_initialized(device) <= 0) {