From 2094c86d5c6f0dfddce8ce05b11b6a14f52cbac3 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 5 Feb 2012 12:02:37 +0100 Subject: [PATCH] Continue inotify event handling even after failure in one event If read() on the inotify handle gave us several events at once, and handling one of them resulted in whatever error, there is little reason not to try handling the rest of the events. Signed-off-by: Stefan Richter --- src/fw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/fw.c b/src/fw.c index 558767c..cccfb7d 100644 --- a/src/fw.c +++ b/src/fw.c @@ -434,16 +434,14 @@ handle_inotify(raw1394handle_t handle, struct epoll_closure *ec, { fw_handle_t fwhandle = handle->mode.fw; struct inotify_event *event; - int len; + ssize_t len; int retval = 0; event = (struct inotify_event *) fwhandle->buffer; len = read(fwhandle->inotify_fd, event, BUFFER_SIZE); while (len >= sizeof(struct inotify_event)) { - retval = process_inotify_event(fwhandle, event); - if (retval == -1) - break; + retval |= process_inotify_event(fwhandle, event); len -= sizeof(struct inotify_event) + event->len; event = (struct inotify_event *) ((char *)event + (sizeof(struct inotify_event) + event->len));