Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2001 10:09:39 -0700
From:      "David O'Brien" <obrien@FreeBSD.ORG>
To:        Peter Pentchev <roam@orbitel.bg>
Cc:        Ruslan Ermilov <ru@FreeBSD.ORG>, Nik Clayton <nik@FreeBSD.ORG>, arch@FreeBSD.ORG
Subject:   Re: [PATCH] syscons ioctl() to grab text mode buffer
Message-ID:  <20010517100939.A60619@dragon.nuxi.com>
In-Reply-To: <20010517150823.A39834@ringworld.oblivion.bg>; from roam@orbitel.bg on Thu, May 17, 2001 at 03:08:23PM %2B0300
References:  <20010517121902.A3047@catkin.nothing-going-on.org> <20010517145209.C55371@sunbay.com> <20010517150823.A39834@ringworld.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 17, 2001 at 03:08:23PM +0300, Peter Pentchev wrote:
> > -	result = ioctl(fd, CONS_GETINFO, &info);
> > -	if (result != 0) {
> > -		perror("getinfo failed");
> > -		exit(1);
> > -	}
> > +	if (ioctl(fd, CONS_GETINFO, &info) == -1)
> > +		err(1, "ioctl(CONS_GETINFO)");
> 
> Wouldn't it be better to check for < 0 here, too?
> More compatible in the long run..

Uh.. why?

    RETURN VALUES
         If an error has occurred, a value of -1 is returned and errno is
         set to indicate the error.

the return is set to "-1", not -20, not -100; but -1, peroid.  Or were
you planning on changing this in the future?  Using "< 0" is just sloppy
coding and it even caused me big problems porting bits to 286 Xenix in
the past.

-- 
-- David  (obrien@FreeBSD.org)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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