Author: wulf
Date: Sun Mar 29 23:01:36 2020
New Revision: 359429
URL: https://svnweb.freebsd.org/changeset/base/359429
Log:
evdev: return error rather than zero-length data on blocked read()
if blocked process has been woken up by evdev device destruction.
MFC after: 2 weeks
Modified:
head/sys/dev/evdev/cdev.c
Modified: head/sys/dev/evdev/cdev.c
==============================================================================
--- head/sys/dev/evdev/cdev.c Sun Mar 29 23:00:33 2020 (r359428)
+++ head/sys/dev/evdev/cdev.c Sun Mar 29 23:01:36 2020 (r359429)
@@ -217,6 +217,8 @@ evdev_read(struct cdev *dev, struct uio *uio, int iofl
client->ec_blocked = true;
ret = mtx_sleep(client, &client->ec_buffer_mtx,
PCATCH, "evread", 0);
+ if (ret == 0 && client->ec_revoked)
+ ret = ENODEV;
}
}
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"