diff options
author | Rob Landley <rob@landley.net> | 2012-11-13 17:14:08 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-11-13 17:14:08 -0600 |
commit | 7aa651a6a4496d848f86de9b1e6b3a003256a01f (patch) | |
tree | 6995fb4b7cc2e90a6706b0239ebaf95d9dbab530 /toys/posix/nice.c | |
parent | 571b0706cce45716126776d0ad0f6ac65f4586e3 (diff) | |
download | toybox-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/nice.c')
-rw-r--r-- | toys/posix/nice.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/toys/posix/nice.c b/toys/posix/nice.c index d45429f8..4b587ee6 100644 --- a/toys/posix/nice.c +++ b/toys/posix/nice.c @@ -1,6 +1,4 @@ -/* vi: set sw=4 ts=4: - * - * nice.c - Run a program at a different niceness level. +/* nice.c - Run a program at a different niceness level. * * Copyright 2010 Rob Landley <rob@landley.net> * @@ -9,32 +7,32 @@ USE_NICE(NEWTOY(nice, "^<1n#", TOYFLAG_USR|TOYFLAG_BIN)) config NICE - bool "nice" - default y - help - usage: nice [-n PRIORITY] command [args...] + bool "nice" + default y + help + usage: nice [-n PRIORITY] command [args...] - Run a command line at an increased or decreased scheduling priority. + Run a command line at an increased or decreased scheduling priority. - Higher numbers make a program yield more CPU time, from -20 (highest - priority) to 19 (lowest). By default processes inherit their parent's - niceness (usually 0). By default this command adds 10 to the parent's - priority. Only root can set a negative niceness level. + Higher numbers make a program yield more CPU time, from -20 (highest + priority) to 19 (lowest). By default processes inherit their parent's + niceness (usually 0). By default this command adds 10 to the parent's + priority. Only root can set a negative niceness level. */ #define FOR_nice #include "toys.h" GLOBALS( - long priority; + long priority; ) void nice_main(void) { - if (!toys.optflags) TT.priority = 10; + if (!toys.optflags) TT.priority = 10; - errno = 0; - if (nice(TT.priority)==-1 && errno) perror_exit("Can't set priority"); + errno = 0; + if (nice(TT.priority)==-1 && errno) perror_exit("Can't set priority"); - xexec(toys.optargs); + xexec(toys.optargs); } |