From owner-freebsd-bugs Wed Apr 10 6:41:44 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from relay1.macomnet.ru (relay1.macomnet.ru [195.128.64.10]) by hub.freebsd.org (Postfix) with ESMTP id 5CA0437B405; Wed, 10 Apr 2002 06:41:39 -0700 (PDT) Received: from news1.macomnet.ru (news1.macomnet.ru [195.128.64.14]) by relay1.macomnet.ru (8.11.6/8.11.6) with ESMTP id g3ADfZU10143526; Wed, 10 Apr 2002 17:41:35 +0400 (MSD) Date: Wed, 10 Apr 2002 17:41:35 +0400 (MSD) From: Maxim Konovalov To: David Schultz Cc: maxim@FreeBSD.ORG, Subject: Re: bin/34076: [PATCH] Add -n flag to renice; update docs In-Reply-To: <20020410044126.A64711@HAL9000.wox.org> Message-ID: <20020410173942.O50181-100000@news1.macomnet.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 04:41-0700, Apr 10, 2002, David Schultz wrote: > Thus spake maxim@FreeBSD.org : > > Synopsis: [PATCH] Add -n flag to renice; update docs > > > > State-Changed-From-To: open->patched > > State-Changed-By: maxim > > State-Changed-When: Wed Apr 10 04:18:40 PDT 2002 > > State-Changed-Why: > > A similar diff were committed to -current. Thanks! > > I haven't tried it, but I think there are two slight bugs in your > version of the patch. The getnum() addition is very nice, though. > > + if (strcmp(*argv, "-n") == 0) { > + incr = 1; > + argc--, argv++; > + if (argc == 0) > + usage(); > + } > > Shouldn't it say `argc < 2' instead of `argc == 0'? At least one > process must be specified. Yes, you are right. > Also, I think the bounds check on `prio' needs to be removed from > main(). It prevents negative adjustments from working; donice() > does the right check. Fixed in rev. 1.11. -- Maxim Konovalov, MAcomnet, Internet Dept., system engineer phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message