chiark / gitweb /
udev: net_setup_link builtin should print the reason why something fails
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Jul 2014 13:13:29 +0000 (15:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Jul 2014 13:13:29 +0000 (15:13 +0200)
Let's tell users what is going wrong.

src/udev/udev-builtin-net_setup_link.c

index 3cd384e94dc8ecf144dc039317175fc9bc7a959c..6207269ab9cd129721e9d772b430df7d01122bba 100644 (file)
@@ -43,17 +43,17 @@ static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
         r = link_config_get(ctx, dev, &link);
         if (r < 0) {
                 if (r == -ENOENT) {
-                        log_debug("No matching link configuration found");
+                        log_debug("No matching link configuration found.");
                         return EXIT_SUCCESS;
                 } else {
-                        log_error("Could not get link config");
+                        log_error("Could not get link config: %s", strerror(-r));
                         return EXIT_FAILURE;
                 }
         }
 
         r = link_config_apply(ctx, link, dev, &name);
         if (r < 0) {
-                log_error("Could not apply link config to %s", udev_device_get_sysname(dev));
+                log_error("Could not apply link config to %s: %s", udev_device_get_sysname(dev), strerror(-r));
                 return EXIT_FAILURE;
         }
 
@@ -77,18 +77,18 @@ static int builtin_net_setup_link_init(struct udev *udev) {
         if (r < 0)
                 return r;
 
-        log_debug("Created link configuration context");
+        log_debug("Created link configuration context.");
         return 0;
 }
 
 static void builtin_net_setup_link_exit(struct udev *udev) {
         link_config_ctx_free(ctx);
         ctx = NULL;
-        log_debug("Unloaded link configuration context");
+        log_debug("Unloaded link configuration context.");
 }
 
 static bool builtin_net_setup_link_validate(struct udev *udev) {
-        log_debug("Check if link configuration needs reloading");
+        log_debug("Check if link configuration needs reloading.");
         if (!ctx)
                 return false;