summaryrefslogtreecommitdiffstats
path: root/usr.bin/nice/nice.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/nice/nice.c')
-rw-r--r--usr.bin/nice/nice.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c
index 6b905d9..9805bfa 100644
--- a/usr.bin/nice/nice.c
+++ b/usr.bin/nice/nice.c
@@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)nice.c 8.2 (Berkeley) 4/16/94";
+static char sccsid[] = "@(#)nice.c 8.3 (Berkeley) 4/28/95";
#endif /* not lint */
#include <sys/types.h>
@@ -64,16 +64,17 @@ main(argc, argv)
{
int niceness = DEFNICE;
+ if (argv[1] == NULL)
+ usage();
if (argv[1][0] == '-')
if (argv[1][1] == '-' || isdigit(argv[1][1])) {
niceness = atoi(argv[1] + 1);
++argv;
+ if (argv[1] == NULL)
+ usage();
} else
errx(1, "illegal option -- %s", argv[1]);
- if (argv[1] == NULL)
- usage();
-
errno = 0;
niceness += getpriority(PRIO_PROCESS, 0);
if (errno)
OpenPOWER on IntegriCloud