summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtprio
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2012-05-11 21:52:05 +0000
committerdelphij <delphij@FreeBSD.org>2012-05-11 21:52:05 +0000
commit74d096abd91c76511669dce27e2c49a0e19ee6b9 (patch)
tree584d795c2bf4887b1094c5f5043c677b848d0246 /usr.sbin/rtprio
parent6c7125e2ba9d92835b639af9fb0ed530e46df9ab (diff)
downloadFreeBSD-src-74d096abd91c76511669dce27e2c49a0e19ee6b9.zip
FreeBSD-src-74d096abd91c76511669dce27e2c49a0e19ee6b9.tar.gz
Fix the case where the utility is being used to run a command directly,
this is a regression introduced with r228917. PR: bin/154042 Submitted by: Bugs Beastie <bugsbeastie gmail.com> MFC after: 1 week
Diffstat (limited to 'usr.sbin/rtprio')
-rw-r--r--usr.sbin/rtprio/rtprio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c
index bb72985..a0b67ea 100644
--- a/usr.sbin/rtprio/rtprio.c
+++ b/usr.sbin/rtprio/rtprio.c
@@ -109,9 +109,12 @@ main(int argc, char *argv[])
if (argv[2][0] == '-') {
proc = parseint(argv[2], "pid");
proc = abs(proc);
- if (rtprio(RTP_SET, proc, &rtp) != 0)
- err(1, "RTP_SET");
- } else {
+ }
+
+ if (rtprio(RTP_SET, proc, &rtp) != 0)
+ err(1, "RTP_SET");
+
+ if (proc == 0) {
execvp(argv[2], &argv[2]);
err(1, "execvp: %s", argv[2]);
}
OpenPOWER on IntegriCloud