Fix poll API issue also for nvidiactl.
authorSimon 'corecode' Schubert <corecode@fs.ei.tum.de>
Mon, 14 Jan 2008 00:06:21 +0000 (01:06 +0100)
committerSimon 'corecode' Schubert <corecode@fs.ei.tum.de>
Mon, 14 Jan 2008 00:06:21 +0000 (01:06 +0100)
src/nvidia_ctl.c

index 0077c18..81ebeee 100644 (file)
@@ -107,6 +107,7 @@ int nvidia_ctl_poll(
     struct dev_poll_args *ap
 )
 {
+    int events = ap->a_events;
     nv_state_t *nv;
     struct nvidia_softc *sc;
     struct nvidia_event *et;
@@ -124,9 +125,10 @@ int nvidia_ctl_poll(
     if (et == NULL) {
         nv_unlock_rm(nv);
         selrecord(curthread, &sc->rsel);
+        ap->a_events = 0;
     } else {
         nv_unlock_rm(nv);
-        return (ap->a_events & (POLLIN | POLLPRI | POLLRDNORM));
+        ap->a_events = events & (POLLIN | POLLPRI | POLLRDNORM);
     }
 
     return 0;