While reviewing the all current .d_poll() functions I found those two
which are incoherent with the rest.

- Most of the devices return POLLERR when the device is no longer valid,
  for whatever reason, uhid(4) returns POLLHUP in one of the cases.

- fusepoll() return EINVAL which isn't a POLL* value, here again POLLERR
  is what is wanted.

ok?

Index: dev/usb/uhid.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uhid.c,v
retrieving revision 1.77
diff -u -p -r1.77 uhid.c
--- dev/usb/uhid.c      20 Feb 2020 16:56:52 -0000      1.77
+++ dev/usb/uhid.c      2 Apr 2020 18:08:03 -0000
@@ -420,7 +420,7 @@ uhidpoll(dev_t dev, int events, struct p
                return (POLLERR);
 
        if (usbd_is_dying(sc->sc_hdev.sc_udev))
-               return (POLLHUP);
+               return (POLLERR);
 
        s = splusb();
        if (events & (POLLOUT | POLLWRNORM))
Index: miscfs/fuse/fuse_device.c
===================================================================
RCS file: /cvs/src/sys/miscfs/fuse/fuse_device.c,v
retrieving revision 1.31
diff -u -p -r1.31 fuse_device.c
--- miscfs/fuse/fuse_device.c   20 Feb 2020 16:56:52 -0000      1.31
+++ miscfs/fuse/fuse_device.c   2 Apr 2020 18:08:03 -0000
@@ -523,7 +523,7 @@ fusepoll(dev_t dev, int events, struct p
 
        fd = fuse_lookup(minor(dev));
        if (fd == NULL)
-               return (EINVAL);
+               return (POLLERR);
 
        if (events & (POLLIN | POLLRDNORM))
                if (!SIMPLEQ_EMPTY(&fd->fd_fbufs_in))

Reply via email to