Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163870273
D22513.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22513.diff
View Options
Index: head/sys/compat/linux/linux_event.c
===================================================================
--- head/sys/compat/linux/linux_event.c
+++ head/sys/compat/linux/linux_event.c
@@ -306,7 +306,7 @@
/* flags related to how event is registered */
if ((levents & LINUX_EPOLLONESHOT) != 0)
- *kev_flags |= EV_ONESHOT;
+ *kev_flags |= EV_DISPATCH;
if ((levents & LINUX_EPOLLET) != 0)
*kev_flags |= EV_CLEAR;
if ((levents & LINUX_EPOLLERR) != 0)
@@ -501,16 +501,17 @@
case LINUX_EPOLL_CTL_ADD:
/*
* kqueue_register() return ENOENT if event does not exists
- * and the EV_ADD flag is not set.
+ * and the EV_ADD flag is not set. Reset EV_ENABLE flag to
+ * avoid accidental activation of fired oneshot events.
*/
- kev[0].flags &= ~EV_ADD;
+ kev[0].flags &= ~(EV_ADD | EV_ENABLE);
error = kqfd_register(args->epfd, &kev[0], td, M_WAITOK);
if (error != ENOENT) {
error = EEXIST;
goto leave0;
}
error = 0;
- kev[0].flags |= EV_ADD;
+ kev[0].flags |= (EV_ADD | EV_ENABLE);
break;
case LINUX_EPOLL_CTL_DEL:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 27, 6:34 PM (11 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35612537
Default Alt Text
D22513.diff (1 KB)
Attached To
Mode
D22513: Linux epoll: Don't deregister file descriptor after EPOLLONESHOT is fired
Attached
Detach File
Event Timeline
Log In to Comment