summaryrefslogtreecommitdiff
path: root/usr.sbin/rtprio
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2012-05-11 21:52:05 +0000
committerXin LI <delphij@FreeBSD.org>2012-05-11 21:52:05 +0000
commit65c4dcd3116336b7d96812bf7870f153244c33a3 (patch)
tree584d795c2bf4887b1094c5f5043c677b848d0246 /usr.sbin/rtprio
parenta20f92a20654fff794f67074907ec4622b2ed9ec (diff)
downloadsrc-test2-65c4dcd3116336b7d96812bf7870f153244c33a3.tar.gz
src-test2-65c4dcd3116336b7d96812bf7870f153244c33a3.zip
Notes
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 bb72985f1995..a0b67ea82768 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]);
}