From 7aa651a6a4496d848f86de9b1e6b3a003256a01f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 13 Nov 2012 17:14:08 -0600 Subject: Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring. --- toys/lsb/hostname.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'toys/lsb/hostname.c') diff --git a/toys/lsb/hostname.c b/toys/lsb/hostname.c index ca436833..23467fb3 100644 --- a/toys/lsb/hostname.c +++ b/toys/lsb/hostname.c @@ -1,6 +1,4 @@ -/* vi: set sw=4 ts=4: - * - * hostname.c - Get/Set the hostname +/* hostname.c - Get/Set the hostname * * Copyright 2012 Andre Renaud * @@ -9,12 +7,12 @@ USE_HOSTNAME(NEWTOY(hostname, NULL, TOYFLAG_BIN)) config HOSTNAME - bool "hostname" - default y - help - usage: hostname [newname] + bool "hostname" + default y + help + usage: hostname [newname] - Get/Set the current hostname + Get/Set the current hostname */ #define FOR_hostname @@ -22,13 +20,12 @@ config HOSTNAME void hostname_main(void) { - const char *hostname = toys.optargs[0]; - if (hostname) { - if (sethostname(hostname, strlen(hostname))) - perror_exit("set failed '%s'", hostname); - } else { - if (gethostname(toybuf, sizeof(toybuf))) - perror_exit("get failed"); - xputs(toybuf); - } + const char *hostname = toys.optargs[0]; + if (hostname) { + if (sethostname(hostname, strlen(hostname))) + perror_exit("set failed '%s'", hostname); + } else { + if (gethostname(toybuf, sizeof(toybuf))) perror_exit("get failed"); + xputs(toybuf); + } } -- cgit v1.2.3