aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb/hostname.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/lsb/hostname.c')
-rw-r--r--toys/lsb/hostname.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/lsb/hostname.c b/toys/lsb/hostname.c
index b3cc1967..daa60cc0 100644
--- a/toys/lsb/hostname.c
+++ b/toys/lsb/hostname.c
@@ -61,7 +61,8 @@ void hostname_main(void)
// We only do the DNS lookup for -d and -f.
if (FLAG(d) || FLAG(f)) {
- if (!(h = gethostbyname(toybuf))) perror_exit("gethostbyname");
+ if (!(h = gethostbyname(toybuf)))
+ error_exit("gethostbyname: %s", hstrerror(h_errno));
snprintf(toybuf, sizeof(toybuf), "%s", h->h_name);
}
dot = toybuf+strcspn(toybuf, ".");