diff options
author | Rob Landley <rob@landley.net> | 2007-11-15 18:30:30 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-11-15 18:30:30 -0600 |
commit | 2c226859cfc911c4a1eea009897050a16714aeec (patch) | |
tree | 9ae05df2a1907a25eb8eec8af0e677775bb3e74b /toys | |
parent | 5d43eb420e036d993a9e100c9b46d7b78e323123 (diff) | |
download | toybox-2c226859cfc911c4a1eea009897050a16714aeec.tar.gz |
Remove trailing whitespace (thanks to Charlie Shepherd), and a couple comment
tweaks.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/df.c | 2 | ||||
-rw-r--r-- | toys/echo.c | 4 | ||||
-rw-r--r-- | toys/mdev.c | 28 | ||||
-rw-r--r-- | toys/oneit.c | 2 | ||||
-rw-r--r-- | toys/toysh.c | 10 |
5 files changed, 23 insertions, 23 deletions
@@ -4,7 +4,7 @@ * * Implemented roughly according to SUSv3: * http://www.opengroup.org/onlinepubs/009695399/utilities/df.html - * + * * usage: df [-k] [-P|-t] [file...] */ diff --git a/toys/echo.c b/toys/echo.c index 397c21a7..d8ee08f2 100644 --- a/toys/echo.c +++ b/toys/echo.c @@ -9,14 +9,14 @@ int echo_main(void) { int i = 0; char *arg, *from = "\\abfnrtv", *to = "\\\a\b\f\n\r\t\v"; - + for (;;) { arg = toys.optargs[i]; if (!arg) break; if (i++) xputc(' '); // Handle -e - + if (toys.optflags&2) { int c, j = 0; for (;;) { diff --git a/toys/mdev.c b/toys/mdev.c index 53be23e0..a4ddb0b7 100644 --- a/toys/mdev.c +++ b/toys/mdev.c @@ -1,7 +1,7 @@ /* vi:set ts=4: - * + * * mdev - Mini udev for busybox - * + * * Copyright 2005 Rob Landley <rob@landley.net> * Copyright 2005 Frank Sorenson <frank@tuxrocks.com> */ @@ -29,16 +29,16 @@ static void make_device(char *path) close(fd); if (len<1) return; temp[len] = 0; - + // Determine device name, type, major and minor - + device_name = strrchr(path, '/') + 1; type = path[5]=='c' ? S_IFCHR : S_IFBLK; major = minor = 0; sscanf(temp, "%u:%u", &major, &minor); // If we have a config file, look up permissions for this device - + if (CFG_MDEV_CONF) { char *conf, *pos, *end; @@ -53,7 +53,7 @@ static void make_device(char *path) for (pos = conf; pos-conf<len;) { int field; char *end2; - + line++; // find end of this line for(end = pos; end-conf<len && *end!='\n'; end++); @@ -78,7 +78,7 @@ static void make_device(char *path) xregcomp(&match, regex, REG_EXTENDED); result=regexec(&match, device_name, 1, &off, 0); regfree(&match); - + // If not this device, skip rest of line if (result || off.rm_so || off.rm_eo!=strlen(device_name)) @@ -159,7 +159,7 @@ static void find_dev(char *path) for (;;) { struct dirent *entry = readdir(dir); - + if (!entry) break; // Skip "." and ".." (also skips hidden files, which is ok) @@ -171,12 +171,12 @@ static void find_dev(char *path) find_dev(path); path[len] = 0; } - + // If there's a dev entry, mknod it - + if (strcmp(entry->d_name, "dev")) make_device(path); } - + closedir(dir); } @@ -188,9 +188,9 @@ int mdev_main(int argc, char *argv[]) strcpy(toybuf, "/sys/class"); find_dev(toybuf); return 0; - } - + } + // hotplug support goes here - + return 0; } diff --git a/toys/oneit.c b/toys/oneit.c index 1f87e5f2..3ac5db4f 100644 --- a/toys/oneit.c +++ b/toys/oneit.c @@ -30,7 +30,7 @@ int oneit_main(void) sync(); reboot(toys.optflags ? RB_POWER_OFF : RB_AUTOBOOT); } - + // Redirect stdio to /dev/tty0, with new session ID, so ctrl-c works. setsid(); for (i=0; i<3; i++) { diff --git a/toys/toysh.c b/toys/toysh.c index f7d86ab9..ced1145d 100644 --- a/toys/toysh.c +++ b/toys/toysh.c @@ -1,5 +1,5 @@ /* vi: set sw=4 ts=4: - * + * * toysh - toybox shell * * Copyright 2006 Rob Landley <rob@landley.net> @@ -80,11 +80,11 @@ static char *parse_pipeline(char *cmdline, struct pipeline *line) if (!cmdline) return 0; if (CFG_TOYSH_JOBCTL) line->cmdline = cmdline; - + // Parse command into argv[] for (;;) { char *end; - + // Skip leading whitespace and detect end of line. while (isspace(*start)) start++; if (!*start || *start=='#') { @@ -192,7 +192,7 @@ int cd_main(void) } int exit_main(void) -{ +{ exit(*toys.optargs ? atoi(*toys.optargs) : 0); } @@ -216,6 +216,6 @@ int toysh_main(void) free(command); } } - + return 1; } |