X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/96f3a8a54eeb3b2294ed953dad8b15349f3e2703..72f5a0d69ad43e7329064f415b4f8df3c1c2ccec:/components/hostname.c?ds=sidebyside diff --git a/components/hostname.c b/components/hostname.c index 45dbb5b..d7c10c8 100644 --- a/components/hostname.c +++ b/components/hostname.c @@ -1,5 +1,7 @@ /* See LICENSE file for copyright and license details. */ +#include #include +#include #include #include "../util.h" @@ -8,7 +10,7 @@ const char * hostname(void) { if (gethostname(buf, sizeof(buf)) == -1) { - fprintf(stderr, "gethostbyname failed"); + fprintf(stderr, "gethostbyname: %s\n", strerror(errno)); return NULL; }