Commit c6c4cbaa authored by Benjamin Berg's avatar Benjamin Berg Committed by Johannes Berg
Browse files

um: chan_user: catch EINTR when reading and writing



If the read/write function returns an error then we expect to see an
event/IRQ later on. However, this will only happen after an EAGAIN as we
are using edge based event triggering.

As such, EINTR needs to be caught should it happen.

Signed-off-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20231018123643.1255813-2-benjamin@sipsolutions.net


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c140a5bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ int generic_read(int fd, __u8 *c_out, void *unused)
{
	int n;

	n = read(fd, c_out, sizeof(*c_out));
	CATCH_EINTR(n = read(fd, c_out, sizeof(*c_out)));
	if (n > 0)
		return n;
	else if (n == 0)
@@ -39,7 +39,7 @@ int generic_write(int fd, const __u8 *buf, size_t n, void *unused)
{
	int err;

	err = write(fd, buf, n);
	CATCH_EINTR(err = write(fd, buf, n));
	if (err > 0)
		return err;
	else if (errno == EAGAIN)