Author: kib
Date: Wed Oct 22 09:06:36 2014
New Revision: 273461
URL: https://svnweb.freebsd.org/changeset/base/273461

Log:
  MFC r273130:
  Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the caller
  is interested in i/o state.  Return POLLNVAL for invalid bits, similar
  to poll_no_poll().

Modified:
  stable/10/sys/fs/deadfs/dead_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/deadfs/dead_vnops.c
==============================================================================
--- stable/10/sys/fs/deadfs/dead_vnops.c        Wed Oct 22 09:04:56 2014        
(r273460)
+++ stable/10/sys/fs/deadfs/dead_vnops.c        Wed Oct 22 09:06:36 2014        
(r273461)
@@ -163,16 +163,19 @@ dead_write(ap)
        return (EIO);
 }
 
-/*
- * Trivial poll routine that always returns POLLHUP.
- * This is necessary so that a process which is polling a file
- * gets notified when that file is revoke()d.
- */
 static int
 dead_poll(ap)
        struct vop_poll_args *ap;
 {
-       return (POLLHUP);
+
+       if (ap->a_events & ~POLLSTANDARD)
+               return (POLLNVAL);
+
+       /*
+        * Let the user find out that the descriptor is gone.
+        */
+       return (POLLHUP | ((POLLIN | POLLRDNORM) & ap->a_events));
+
 }
 
 static int
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to