aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/uname.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-11-13 17:14:08 -0600
committerRob Landley <rob@landley.net>2012-11-13 17:14:08 -0600
commit7aa651a6a4496d848f86de9b1e6b3a003256a01f (patch)
tree6995fb4b7cc2e90a6706b0239ebaf95d9dbab530 /toys/posix/uname.c
parent571b0706cce45716126776d0ad0f6ac65f4586e3 (diff)
downloadtoybox-7aa651a6a4496d848f86de9b1e6b3a003256a01f.tar.gz
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.
Diffstat (limited to 'toys/posix/uname.c')
-rw-r--r--toys/posix/uname.c72
1 files changed, 35 insertions, 37 deletions
diff --git a/toys/posix/uname.c b/toys/posix/uname.c
index fcc92a08..2c1a0504 100644
--- a/toys/posix/uname.c
+++ b/toys/posix/uname.c
@@ -1,6 +1,4 @@
-/* vi: set sw=4 ts=4:
- *
- * uname.c - return system name
+/* uname.c - return system name
*
* Copyright 2008 Rob Landley <rob@landley.net>
*
@@ -9,19 +7,19 @@
USE_UNAME(NEWTOY(uname, "amvrns", TOYFLAG_BIN))
config UNAME
- bool "uname"
- default y
- help
- usage: uname [-asnrvmpio]
+ bool "uname"
+ default y
+ help
+ usage: uname [-asnrvmpio]
- Print system information.
+ Print system information.
- -s System name
- -n Network (domain) name
- -r Release number
- -v Version (build date)
- -m Machine (hardware) name
- -a All of the above
+ -s System name
+ -n Network (domain) name
+ -r Release number
+ -v Version (build date)
+ -m Machine (hardware) name
+ -a All of the above
*/
#define FOR_uname
@@ -42,34 +40,34 @@ config UNAME
void uname_main(void)
{
- int i, flags = toys.optflags, needspace=0;
+ int i, flags = toys.optflags, needspace=0;
- uname((void *)toybuf);
+ uname((void *)toybuf);
- if (!flags) flags = FLAG_s;
- for (i=0; i<5; i++) {
- char *c = toybuf+(65*i);
+ if (!flags) flags = FLAG_s;
+ for (i=0; i<5; i++) {
+ char *c = toybuf+(65*i);
- if (flags & ((1<<i)|FLAG_a)) {
- int len = strlen(c);
+ if (flags & ((1<<i)|FLAG_a)) {
+ int len = strlen(c);
- // This problem originates in autoconf, so of course the solution
- // is horribly ugly.
+ // This problem originates in autoconf, so of course the solution
+ // is horribly ugly.
#ifdef GROSS
- if (i==4 && !strcmp(c,"x86_64")) {
- printf(GROSS);
- continue;
- }
+ if (i==4 && !strcmp(c,"x86_64")) {
+ printf(GROSS);
+ continue;
+ }
#endif
- if (needspace++) {
- // We can't decrement on the first entry, because
- // needspace would be 0
- *(--c)=' ';
- len++;
- }
- xwrite(1, c, len);
- }
- }
- putchar('\n');
+ if (needspace++) {
+ // We can't decrement on the first entry, because
+ // needspace would be 0
+ *(--c)=' ';
+ len++;
+ }
+ xwrite(1, c, len);
+ }
+ }
+ putchar('\n');
}