X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/ee5ec756218c852385c5ba5ef0f75b47ba59ec39..ab4f24a612fd40bb58b5504e979ad476533dd891:/components/hostname.c?ds=sidebyside

diff --git a/components/hostname.c b/components/hostname.c
index d41465f..23da677 100644
--- a/components/hostname.c
+++ b/components/hostname.c
@@ -1,7 +1,5 @@
 /* See LICENSE file for copyright and license details. */
-#include <errno.h>
 #include <stdio.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "../util.h"
@@ -10,7 +8,7 @@ const char *
 hostname(void)
 {
 	if (gethostname(buf, sizeof(buf)) < 0) {
-		fprintf(stderr, "gethostbyname: %s\n", strerror(errno));
+		warn("gethostbyname:");
 		return NULL;
 	}