From 74d096abd91c76511669dce27e2c49a0e19ee6b9 Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 11 May 2012 21:52:05 +0000 Subject: 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 MFC after: 1 week --- usr.sbin/rtprio/rtprio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.sbin') 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]); } -- cgit v1.1