Subject: Re: Wine & NetBSD?
To: David Laight <David.Laight@btinternet.com>
From: Bang Jun-Young <junyoung@mogua.com>
List: tech-kern
Date: 12/06/2001 00:38:24
On Wed, Dec 05, 2001 at 02:08:02PM -0000, David Laight wrote:
> 'Tis a bug in netbsd....
> 
> >From the single unix spec...
> 
> "If the value of fd is less than 0, events is ignored and revents is set to 0 in that entry on return from poll(). "

diff -u -r1.59 -r1.60
--- sys_generic.c	2001/11/12 15:25:23	1.59
+++ sys_generic.c	2001/11/14 18:43:58	1.60
@@ -871,9 +871,11 @@
 	fdp = p->p_fd;
 	n = 0;
 	for (i = 0; i < nfd; i++, fds++) {
-		if ((u_int)fds->fd >= fdp->fd_nfiles) {
+		if (fds->fd >= fdp->fd_nfiles) {
 			fds->revents = POLLNVAL;
 			n++;
+		} else if (fds->fd < 0) {
+			fds->revents = 0;
 		} else {
 			if ((fp = fd_getfile(fdp, fds->fd)) == NULL) {
 				fds->revents = POLLNVAL;

Jun-Young

-- 
Bang Jun-Young <junyoung@mogua.com>