chiark / gitweb /
config_parse_set_status: put signals in the correct set
[elogind.git] / src / core / hostname-setup.c
index 57baa7927504197d881a024ede7304cfad18ad3a..6664e8952c2b30de430f4b241d0d307f78e30a87 100644 (file)
@@ -64,7 +64,7 @@ int hostname_setup(void) {
                 if (r == -ENOENT)
                         enoent = true;
                 else
-                        log_warning("Failed to read configured hostname: %s", strerror(-r));
+                        log_warning_errno(r, "Failed to read configured hostname: %m");
 
                 hn = NULL;
         } else
@@ -82,10 +82,8 @@ int hostname_setup(void) {
                 hn = "localhost";
         }
 
-        if (sethostname_idempotent(hn) < 0) {
-                log_warning("Failed to set hostname to <%s>: %m", hn);
-                return -errno;
-        }
+        if (sethostname_idempotent(hn) < 0)
+                return log_warning_errno(errno, "Failed to set hostname to <%s>: %m", hn);
 
         log_info("Set hostname to <%s>.", hn);
         return 0;