From owner-svn-src-head@FreeBSD.ORG Thu Jan 6 21:08:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716AB1065693; Thu, 6 Jan 2011 21:08:40 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id ED0548FC17; Thu, 6 Jan 2011 21:08:38 +0000 (UTC) Received: by wyf19 with SMTP id 19so16952210wyf.13 for ; Thu, 06 Jan 2011 13:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=9LLJpGx5+6zDxkO9k+CP6wwQyotKtAQrk057zEkhc6c=; b=USZVr+xiI869nSrvYdM+qD4d4akuoBx4R525XA15mGm1Y32PA2FSgBPETDdX9yXlf/ Un/iPL9fUABhIYNQs27aL79k5dphzeoCJEMP+BHdO74MoQO6oFUzXWtbP2DNk/aX3YgP VU279VbiqpjPS16KtXIIGt7snjjwc/2uvMcEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=GvC488wILUcwe3E6QqW1ml6hD+LXpCL/Im36TIiyjxeC0mvhG9tBLKJ2hRdof7+dL+ 69xxj7ge2kqC9kOMldtwMZjSmnsNmomYa4Qwi50uodMKdJ1uBzvnz+6WV39mYwIaVGgg 2QAp3hDohE/h7eXqUAa0MTySvdirX9iEIlSX0= MIME-Version: 1.0 Received: by 10.216.191.215 with SMTP id g65mr914071wen.16.1294348117726; Thu, 06 Jan 2011 13:08:37 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Thu, 6 Jan 2011 13:08:37 -0800 (PST) In-Reply-To: <20110106204157.GA41314@freebsd.org> References: <201101041413.p04EDA4f038360@svn.freebsd.org> <20110106204157.GA41314@freebsd.org> Date: Thu, 6 Jan 2011 13:08:37 -0800 X-Google-Sender-Auth: MtaY_-jVlvEYK9zCVFyIDPQYM0E Message-ID: From: Garrett Cooper To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r216955 - head/usr.sbin/rtprio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 21:08:40 -0000 On Thu, Jan 6, 2011 at 12:41 PM, Alexander Best wrote= : ... > this causes problems when pid is -0: > > [id|rt]prio -t -0 and [id|rt]prio 10 -0 will try to run "0" via execvp(). > beforehand however this will also trigger rtprio(). > > a better solution would be to do: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (argv[2][0] =3D=3D '-') { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0proc =3D parseint(argv[2] = + 1, "pid"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (rtprio(RTP_SET, proc, = &rtp) !=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0err(1, "RT= P_SET"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0execvp(argv[2], &argv[2]); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0err(1, "%s= ", argv[2]); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} How did you get a pid of -0? Thanks, -Garrett