diff options
author | Radek Novacek <rnovacek@redhat.com> | 2014-01-20 14:20:48 +0100 |
---|---|---|
committer | Radek Novacek <rnovacek@redhat.com> | 2014-01-21 15:40:04 +0100 |
commit | d41a4b118be039408d74f1f2eda4767d42c0b00b (patch) | |
tree | 3a96e007979053b04605c287829d504b9b99c503 | |
parent | 8ef9b8fb289d287f7000c5c9f30568f76e0de94a (diff) | |
download | openlmi-providers-d41a4b118be039408d74f1f2eda4767d42c0b00b.tar.gz openlmi-providers-d41a4b118be039408d74f1f2eda4767d42c0b00b.tar.xz openlmi-providers-d41a4b118be039408d74f1f2eda4767d42c0b00b.zip |
indicationmanager: Handle EOF in inotify read
-rw-r--r-- | src/account/indication_common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/account/indication_common.c b/src/account/indication_common.c index 802bc28..d999176 100644 --- a/src/account/indication_common.c +++ b/src/account/indication_common.c @@ -118,6 +118,12 @@ bool watcher(AccountIndication *ind, void **data) watcher_init(ind); return false; } + if (len == 0) { + // We are at the eof + watcher_destroy(ind); + watcher_init(ind); + return true; + } while (i + (ssize_t) EVENT_SIZE < len) { struct inotify_event *event = (struct inotify_event *) &buffer[i]; if (i + (ssize_t) EVENT_SIZE + event->len > len) { |