X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/7246dc4381c6c95454672a5c1aff65a02d6d3747..ec306623df7321a4e6ec11f70b6152a2e614d1ed:/components/hostname.c?ds=inline

diff --git a/components/hostname.c b/components/hostname.c
index aed77a6..23da677 100644
--- a/components/hostname.c
+++ b/components/hostname.c
@@ -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;
 	}