Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2000 10:50:03 -0700 (PDT)
From:      Bill Fumerola <billf@chimesnet.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: i386/21329: change to allow vm86 interrupt calls from userland
Message-ID:  <200009171750.KAA24874@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/21329; it has been noted by GNATS.

From: Bill Fumerola <billf@chimesnet.com>
To: Jonathan Chen <jon@spock.org>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: i386/21329: change to allow vm86 interrupt calls from userland
Date: Sun, 17 Sep 2000 13:43:43 -0400

 On Sun, Sep 17, 2000 at 01:41:10PM -0400, Jonathan Chen wrote:
 
 > Yes, I'm aware of what style() says, but gcc -Wall, in its brokenness,
 > "suggests parentheses around assignment used as truth value".  I have no
 > clue why gcc would think extra parentheses would be cool there, but I
 > decided to silence gcc instead of following style() (and didn't think of
 > the != 0 bit).  Anyway, this should be better:
 
 I think it's gcc's roundabout way of encouraging the practice of explicit
 checks. This makes even more sense when you get into things returning NULL
 and abusing the if(!something_that_might_be_null) case.
 
 > 
 [...]
 > -		if (error = copyin(ua.sub_args, &sa, sizeof(sa)))
 > +		if (p->p_cred->pc_ucred->cr_uid != 0) return EPERM;
 > +
 > +		if (0 != (error = copyin(ua.sub_args, &sa, sizeof(sa))))
 >  			return (error);
 > -		if (error = vm86_intcall(sa.intnum, &sa.vmf))
 > +		if (0 != (error = vm86_intcall(sa.intnum, &sa.vmf)))
 >  			return (error);
 >  		error = copyout(&sa, ua.sub_args, sizeof(sa));
 >  		}
 >  		break;
 > -#endif
 
 #1. You still need the \nreturn EPERM;
 #2. I'd put the != 0 after the call.
 
 -- 
 Bill Fumerola - Network Architect, BOFH / Chimes, Inc.
                 billf@chimesnet.com / billf@FreeBSD.org
 
 
 
 


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?200009171750.KAA24874>