Subject: Re: inconsistent return value from bounds_check_with_label()
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 04/16/2003 17:01:21
On Thu, Apr 10, 2003 at 03:28:54PM +0200, Manuel Bouyer wrote:
> Hi,
> Miod Vallat pointed me out that a commit has been done to OpenBSD to
> work around inconsistent return values from bounds_check_with_label()
> (some will return 0 for error, some will -1).
> As we have a man page stating that bounds_check_with_label() returns -1
> in case of error, I fixed the implementations to be compliant with this
> (return -1 for error, 0 for EOF, 1 otherwise). I also found one case
> where the return value was checked < 0 instead of <= 0, I also fixed it.
> Note that this doesn't cause problems in the current state, as all
> MI place check the return value <= 0, and the only place which checks < 0
> is in a place where the MD bounds_check_with_label() is compliant (it's
> just suboptimal in case of EOF).

FYI, I just commited this.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 24 ans d'experience feront toujours la difference
--