diff options
author | Rob Landley <rob@landley.net> | 2012-09-09 18:44:12 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-09-09 18:44:12 -0500 |
commit | c64c1069291aa580388dab86caec81c6c19ee615 (patch) | |
tree | f643fb352f4dedc9ba5dba4d8f71bbdffb892803 /toys | |
parent | 787eac5f1dac70ee4a6ac79699f6da87b8fd6ee6 (diff) | |
download | toybox-c64c1069291aa580388dab86caec81c6c19ee615.tar.gz |
gethostname: Tighten up error messages slightly, switch to default "y".
Diffstat (limited to 'toys')
-rw-r--r-- | toys/lsb/hostname.c | 6 |
1 files 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); } } |