Xinqi Bao's Git

Clean up header includes
[slstatus.git] / components / hostname.c
index aed77a6..23da677 100644 (file)
@@ -1,5 +1,5 @@
 /* See LICENSE file for copyright and license details. */
-#include <err.h>
+#include <stdio.h>
 #include <unistd.h>
 
 #include "../util.h"
@@ -7,8 +7,8 @@
 const char *
 hostname(void)
 {
-       if (gethostname(buf, sizeof(buf)) == -1) {
-               warn("hostname");
+       if (gethostname(buf, sizeof(buf)) < 0) {
+               warn("gethostbyname:");
                return NULL;
        }