summaryrefslogtreecommitdiff
path: root/arch/um
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin.berg@intel.com>2023-10-18 14:36:41 +0200
committerJohannes Berg <johannes.berg@intel.com>2024-07-03 12:18:01 +0200
commitc6c4cbaa01b61eff2232d8cf4d441565535aa53a (patch)
tree5d5abf9d1d9c002e3bad97c90d50e59d55d9842f /arch/um
parentc140a5bd5da48de353be8bf9356f71a66f622a68 (diff)
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>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/chan_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index ec04e47b9d79..60fcb181835d 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -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)