X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/7246dc4381c6c95454672a5c1aff65a02d6d3747..c1dc896c806693a4a368abf59e6890d32d520074:/components/hostname.c 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 +#include #include #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; }