Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
| inline |
side by side
Simplify format specifiers for uintmax_t
[slstatus.git]
/
components
/
hostname.c
diff --git
a/components/hostname.c
b/components/hostname.c
index
45dbb5b
..
23da677
100644
(file)
--- a/
components/hostname.c
+++ b/
components/hostname.c
@@
-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;
}