PERFORCE change 83422 for review

Robert Watson rwatson at FreeBSD.org
Sun Sep 11 15:06:23 PDT 2005


http://perforce.freebsd.org/chv.cgi?CH=83422

Change 83422 by rwatson at rwatson_peppercorn on 2005/09/11 22:05:22

	When generating polling results for fifos, don't report read-only
	fifos as writable, or write-only fifos as readable.  That would be
	dumb.

Affected files ...

.. //depot/projects/netsmp/src/sys/fs/fifofs/fifo_vnops.c#3 edit

Differences ...

==== //depot/projects/netsmp/src/sys/fs/fifofs/fifo_vnops.c#3 (text+ko) ====

@@ -615,7 +615,7 @@
 	fip = fp->f_data;
 	levents = events &
 	    (POLLIN | POLLINIGNEOF | POLLPRI | POLLRDNORM | POLLRDBAND);
-	if (levents) {
+	if ((fp->f_flag & FREAD) && levents) {
 		/*
 		 * If POLLIN or POLLRDNORM is requested and POLLINIGNEOF is
 		 * not, then convert the first two to the last one.  This
@@ -641,7 +641,7 @@
 		}
 	}
 	levents = events & (POLLOUT | POLLWRNORM | POLLWRBAND);
-	if (levents) {
+	if ((fp->f_flag & FWRITE) && levents) {
 		filetmp.f_data = fip->fi_writesock;
 		filetmp.f_cred = cred;
 		if (filetmp.f_data) {


More information about the p4-projects mailing list