From c64c1069291aa580388dab86caec81c6c19ee615 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 9 Sep 2012 18:44:12 -0500 Subject: gethostname: Tighten up error messages slightly, switch to default "y". --- toys/lsb/hostname.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toys/lsb/hostname.c b/toys/lsb/hostname.c index e64f4ff6..bd319188 100644 --- a/toys/lsb/hostname.c +++ b/toys/lsb/hostname.c @@ -10,7 +10,7 @@ USE_HOSTNAME(NEWTOY(hostname, NULL, TOYFLAG_BIN)) config HOSTNAME bool "hostname" - default n + default y help usage: hostname [newname] @@ -24,10 +24,10 @@ void hostname_main(void) const char *hostname = toys.optargs[0]; if (hostname) { if (sethostname(hostname, strlen(hostname))) - perror_exit("cannot set hostname to '%s'", hostname); + perror_exit("set failed '%s'", hostname); } else { if (gethostname(toybuf, sizeof(toybuf))) - perror_exit("cannot get hostname"); + perror_exit("get failed"); xputs(toybuf); } } -- cgit v1.2.3