Skip to content

Commit 378b803

Browse files
fmeumJiri Kosina
authored andcommitted
hidraw: Return EPOLLOUT from hidraw_poll
Always return EPOLLOUT from hidraw_poll when a device is connected. This is safe since writes are always possible (but will always block). hidraw does not support non-blocking writes and instead always calls blocking backend functions on write requests. Hence, so far, a call to poll never returned EPOLLOUT, which confuses tools like socat. Signed-off-by: Fabian Henneke <[email protected]> In-reply-to: <CA+hv5qkyis03CgYTWeWX9cr0my-d2Oe+aZo+mjmWRXgjrGqyrw@mail.gmail.com> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4832a4d commit 378b803

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hidraw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)
252252

253253
poll_wait(file, &list->hidraw->wait, wait);
254254
if (list->head != list->tail)
255-
return EPOLLIN | EPOLLRDNORM;
255+
return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
256256
if (!list->hidraw->exist)
257257
return EPOLLERR | EPOLLHUP;
258258
return 0;

0 commit comments

Comments
 (0)