X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/7246dc4381c6c95454672a5c1aff65a02d6d3747..e43c3a16f06ccd0c35814e8b47a6f30e81f9c981:/components/hostname.c diff --git a/components/hostname.c b/components/hostname.c index aed77a6..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 #include "../util.h" @@ -8,7 +10,7 @@ const char * hostname(void) { if (gethostname(buf, sizeof(buf)) == -1) { - warn("hostname"); + fprintf(stderr, "gethostbyname: %s\n", strerror(errno)); return NULL; }