changeset 665:0ed044e9e5ca

gethostname: Tighten up error messages slightly, switch to default "y".
author Rob Landley <rob@landley.net>
date Sun, 09 Sep 2012 18:44:12 -0500
parents c60ac785784f
children b88859043af2
files toys/lsb/hostname.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/toys/lsb/hostname.c	Sat Sep 08 01:27:54 2012 -0500
+++ b/toys/lsb/hostname.c	Sun Sep 09 18:44:12 2012 -0500
@@ -10,7 +10,7 @@
 
 config HOSTNAME
 	bool "hostname"
-	default n
+	default y
 	help
 	  usage: hostname [newname]
 
@@ -24,10 +24,10 @@
 	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);
         }
 }