mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-12 19:44:51 -04:00
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: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20231018123643.1255813-2-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
committed by
Johannes Berg
parent
c140a5bd5d
commit
c6c4cbaa01
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user