Xinqi Bao's Git

Update LICENSE
[slstatus.git] / components / hostname.c
index 45dbb5b..23da677 100644 (file)
@@ -7,8 +7,8 @@
 const char *
 hostname(void)
 {
-       if (gethostname(buf, sizeof(buf)) == -1) {
-               fprintf(stderr, "gethostbyname failed");
+       if (gethostname(buf, sizeof(buf)) < 0) {
+               warn("gethostbyname:");
                return NULL;
        }