From 8bb915dd16bfc27fa206a850e9f56439e5e424ee Mon Sep 17 00:00:00 2001 From: ddennedy Date: Thu, 27 Mar 2008 20:25:23 +0000 Subject: [PATCH] eventloop.c: apply patch from Jonas Bonn to retry read when failed with EINTR. This can occur when libraw1394 caller receives a signal while in this read and the caller is not using a signal handler set with signal(). git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@177 53a565d1-3bb7-0310-b661-cf11e63c67ab --- src/eventloop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eventloop.c b/src/eventloop.c index 0ddd455..4a027b2 100644 --- a/src/eventloop.c +++ b/src/eventloop.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "raw1394.h" #include "kernel-raw1394.h" @@ -32,8 +33,8 @@ int raw1394_loop_iterate(struct raw1394_handle *handle) struct raw1394_request req; int retval = 0, channel; - if (read(handle->fd, &req, sizeof(req)) < 0) { - return -1; + while (read(handle->fd, &req, sizeof(req)) < 0) { + if (errno != EINTR) return -1; } switch (req.type) {