Audit nice(1)

1) val is sufficient as "int" (read the standard)
2) BUGFIX: If getpriority fails, it returns -1 and sets errno.
   Previously, it would correctly catch the errno but not take
   care of the fact that by then val has been decremented by 1.
   Only change val if the getpriority-call has been successful.
3) Add LIMIT()-macro from st to increase readability.
4) setpriority returns < 0 on failure
5) Remove bikeshedding-comment. Read the standard if you wonder.
6) return-value trick from env(1)
This commit is contained in:
FRIGN
2015-03-02 16:53:13 +01:00
parent 46f743705b
commit c01641c897
4 changed files with 15 additions and 12 deletions

4
nice.1
View File

@@ -1,4 +1,4 @@
.Dd January 28, 2015
.Dd March 1, 2015
.Dt NICE 1
.Os sbase
.Sh NAME
@@ -25,7 +25,7 @@ ranging from
.Sy -20
(highest priority)
to
.Sy +19
.Sy +20
(lowest priority).
Default is 10.
.El