chiark / gitweb /
networkd: don't assume udev_device_new_from_device_id sets errno
authorTom Gundersen <teg@jklm.no>
Wed, 30 Jul 2014 19:29:34 +0000 (21:29 +0200)
committerTom Gundersen <teg@jklm.no>
Wed, 30 Jul 2014 19:53:38 +0000 (21:53 +0200)
This reverts 6f4d55a8ae04e344a41fc2adef12ad99c2bb2927, as we cannot rely on errno here.

Reported by David Herrmann.

src/network/networkd-link.c

index ec1a97a..5b1376a 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: %m");
-                        return -errno;
+                        log_warning_link(link, "could not find udev device");
+                        return -ENOENT;
                 }
 
                 if (udev_device_get_is_initialized(device) <= 0) {