chiark / gitweb /
remove unused includes
[elogind.git] / src / core / hostname-setup.c
index 72e4c539eff970cb23e0b740a436847aea1adae6..03b0ce3b4dad805d94b2cb7de2afd3c9bb549e89 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <stdio.h>
 #include <errno.h>
-#include <string.h>
 #include <stdlib.h>
 
 #include "hostname-setup.h"
@@ -82,10 +80,8 @@ int hostname_setup(void) {
                 hn = "localhost";
         }
 
-        if (sethostname_idempotent(hn) < 0) {
-                log_warning_errno(errno, "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;