diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2009-04-20 13:58:21 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2009-04-20 13:58:21 +0000 |
commit | 530113ffa82091c5507446d53b554106f95af2ce (patch) | |
tree | 70cf1ea2411ecf8376bb9c75c1550796df6101b3 /usr.bin/renice | |
parent | 766a3b0775f071fc90f4d5596ea776418758a129 (diff) |
Fix renicing a negative pid in historic mode. From Bryan Linton
Diffstat (limited to 'usr.bin/renice')
-rw-r--r-- | usr.bin/renice/renice.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/renice/renice.c b/usr.bin/renice/renice.c index ca4d8c1f8a6..14eab9e1aac 100644 --- a/usr.bin/renice/renice.c +++ b/usr.bin/renice/renice.c @@ -1,4 +1,4 @@ -/* $OpenBSD: renice.c,v 1.13 2008/12/08 21:23:10 millert Exp $ */ +/* $OpenBSD: renice.c,v 1.14 2009/04/20 13:58:20 millert Exp $ */ /* * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: renice.c,v 1.13 2008/12/08 21:23:10 millert Exp $"; +static const char rcsid[] = "$OpenBSD: renice.c,v 1.14 2009/04/20 13:58:20 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -63,7 +63,8 @@ main(int argc, char **argv) err(1, NULL); /* Backwards compatibility: first arg may be priority. */ - if (isdigit((unsigned char)argv[1][0])) { + if (isdigit((unsigned char)argv[1][0]) || + (argv[1][0] == '-' && isdigit((unsigned char)argv[1][1]))) { argv[0] = "-n"; argc++; argv--; |