summaryrefslogtreecommitdiffstats
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
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>
-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));
tar.com/avatar/2fce9f8dd90949315d789a6546dfacd0?s=13&d=retro' width='13' height='13' alt='Gravatar' /> bencollins 4-5/+14 2003-04-23add libtoolize to bootstrapGravatar ddennedy 1-1/+10 2003-04-21added Dan Maas' rawiso docsGravatar ddennedy 1-32/+295 2003-04-07new_handle_on_port() error path fix from Jim RadfordGravatar dmaas 1-1/+3 2003-03-26add raw1394_new_handle_on_port() convenience functionGravatar dmaas 2-1/+41 2003-02-22Updates for new rawiso ioctl interface.Gravatar bencollins 3-37/+125 2003-01-15add iso_xmit_sync() and iso_xmit_write(); clean up iso handling a bitGravatar dmaas 5-39/+161 2003-01-15implement tag matching for rawiso receptionGravatar dmaas 3-4/+12 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; brought...Gravatar anonymous 3-124/+48 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488