summaryrefslogtreecommitdiffstats
path: root/src/fw.c
diff options
context:
space:
mode:
authorGravatar Stefan Richter 2012-02-05 12:02:37 +0100
committerGravatar Stefan Richter 2012-02-05 12:02:37 +0100
commit2094c86d5c6f0dfddce8ce05b11b6a14f52cbac3 (patch)
treed716baa6dc3bc53f506d31c34812e3f227936998 /src/fw.c
parentProcess multiple inotify events (diff)
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 <stefanr@s5r6.in-berlin.de>
Diffstat (limited to '')
-rw-r--r--src/fw.c6
1 files 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));