From owner-svn-src-head@FreeBSD.ORG Thu Jan 6 21:14:16 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 528E4106566B; Thu, 6 Jan 2011 21:14:16 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2608FC18; Thu, 6 Jan 2011 21:14:14 +0000 (UTC) Received: by wwf26 with SMTP id 26so16576568wwf.31 for ; Thu, 06 Jan 2011 13:14:14 -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=t3CI/ArDUGCv3dUZLxt9X/dwWDdvjQKeA/HwSXYQ3/E=; b=pihqUTXoj2WEDsAOcQqMBnb5d6pW16u0DaWdF5luqp2JhtymPLb2FIKMEI8rjS64x+ ZcQ3BfRfP4A26Gvt1Jvvu3XSdlc1SEYuVKAQBJ7ZJbCCSy6ceGNHRtRTO8RAPihkcJ7p vvTmDcyK3q7/Cl4vpRzQ2Bfd68fnl+g20/voc= 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=Zg0p5ZIUP8v5ken+SmHs967Ag+0bvgSfJhbSQmS9I0rDuDdZ9jUyy4FMTgyT8VGEmn xBGUAxJ+AmaRrRB/oQn80Ry68rYbBPChXgXTGRsnhLPAms0iGL3Y5GiQIPPg/1ggV/dA lpST7XHfsnmmOh/71tAKoEY6pfsqB6ANzgAJA= MIME-Version: 1.0 Received: by 10.216.185.142 with SMTP id u14mr902964wem.31.1294348454005; Thu, 06 Jan 2011 13:14:14 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Thu, 6 Jan 2011 13:14:13 -0800 (PST) In-Reply-To: <20110106211017.GA46874@freebsd.org> References: <201101041413.p04EDA4f038360@svn.freebsd.org> <20110106204157.GA41314@freebsd.org> <20110106211017.GA46874@freebsd.org> Date: Thu, 6 Jan 2011 13:14:13 -0800 X-Google-Sender-Auth: Kws_QjZw_DvJHpVTNX7tpOxMQQg 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:14:16 -0000 On Thu, Jan 6, 2011 at 1:10 PM, Alexander Best wrote: > On Thu Jan =A06 11, Garrett Cooper wrote: >> On Thu, Jan 6, 2011 at 12:41 PM, Alexander Best wr= ote: >> >> ... >> >> > 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, pro= c, &rtp) !=3D 0) >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0err(1, = "RTP_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? > > pid 0 stands for the current process. see rptio(2). Man, that's awesome syntax >.<. -Garrett