chiark / gitweb /
treewide: no need to negate errno for log_*_errno()
[elogind.git] / src / udev / net / link-config.c
index ee2865a863e1fe9d8b0d77f60a2637c77f57954b..7d1bdc9ee739e1b03236fff7f1721556d29ab917 100644 (file)
@@ -20,7 +20,6 @@
 ***/
 
 #include <netinet/ether.h>
-#include <linux/netdevice.h>
 
 #include "sd-id128.h"
 
@@ -175,11 +174,10 @@ static bool enable_name_policy(void) {
         size_t l;
 
         r = proc_cmdline(&line);
-        if (r < 0)
-                log_warning("Failed to read /proc/cmdline, ignoring: %s",
-                            strerror(-r));
-        if (r <= 0)
+        if (r < 0) {
+                log_warning_errno(r, "Failed to read /proc/cmdline, ignoring: %m");
                 return true;
+        }
 
         FOREACH_WORD_QUOTED(word, l, line, state)
                 if (strneq(word, "net.ifnames=0", l))
@@ -197,7 +195,7 @@ int link_config_load(link_config_ctx *ctx) {
 
         if (!enable_name_policy()) {
                 ctx->enable_name_policy = false;
-                log_info("Network interface NamePolicy= disabled on kernel commandline, ignoring.");
+                log_info("Network interface NamePolicy= disabled on kernel command line, ignoring.");
         }
 
         /* update timestamp */
@@ -205,7 +203,7 @@ int link_config_load(link_config_ctx *ctx) {
 
         r = conf_files_list_strv(&files, ".link", NULL, link_dirs);
         if (r < 0) {
-                log_error("failed to enumerate link files: %s", strerror(-r));
+                log_error_errno(r, "failed to enumerate link files: %m");
                 return r;
         }