Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2002 17:41:35 +0400 (MSD)
From:      Maxim Konovalov <maxim@macomnet.ru>
To:        David Schultz <dschultz@uclink.Berkeley.EDU>
Cc:        maxim@FreeBSD.ORG, <freebsd-bugs@FreeBSD.ORG>
Subject:   Re: bin/34076: [PATCH] Add -n flag to renice; update docs
Message-ID:  <20020410173942.O50181-100000@news1.macomnet.ru>
In-Reply-To: <20020410044126.A64711@HAL9000.wox.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 04:41-0700, Apr 10, 2002, David Schultz wrote:

> Thus spake maxim@FreeBSD.org <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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020410173942.O50181-100000>