From: Benjamin Berg <benjamin.b...@intel.com>

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.b...@intel.com>
---
 arch/um/drivers/chan_user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 25727ed648b7..29c68820522a 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -23,7 +23,7 @@ int generic_read(int fd, char *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 char *buf, int 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)
-- 
2.41.0


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

Reply via email to