Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 378b8037 authored by Fabian Henneke's avatar Fabian Henneke Committed by Jiri Kosina
Browse files

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: default avatarFabian Henneke <fabian.henneke@gmail.com>
In-reply-to: <CA+hv5qkyis03CgYTWeWX9cr0my-d2Oe+aZo+mjmWRXgjrGqyrw@mail.gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 4832a4da
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -252,7 +252,7 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)


	poll_wait(file, &list->hidraw->wait, wait);
	poll_wait(file, &list->hidraw->wait, wait);
	if (list->head != list->tail)
	if (list->head != list->tail)
		return EPOLLIN | EPOLLRDNORM;
		return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
	if (!list->hidraw->exist)
	if (!list->hidraw->exist)
		return EPOLLERR | EPOLLHUP;
		return EPOLLERR | EPOLLHUP;
	return 0;
	return 0;