aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-09-09 18:44:12 -0500
committerRob Landley <rob@landley.net>2012-09-09 18:44:12 -0500
commitc64c1069291aa580388dab86caec81c6c19ee615 (patch)
treef643fb352f4dedc9ba5dba4d8f71bbdffb892803 /toys
parent787eac5f1dac70ee4a6ac79699f6da87b8fd6ee6 (diff)
downloadtoybox-c64c1069291aa580388dab86caec81c6c19ee615.tar.gz
gethostname: Tighten up error messages slightly, switch to default "y".
Diffstat (limited to 'toys')
-rw-r--r--toys/lsb/hostname.c6
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);
}
}