summaryrefslogtreecommitdiffstats
path: root/src/account
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2014-01-20 14:20:48 +0100
committerRadek Novacek <rnovacek@redhat.com>2014-01-21 15:40:04 +0100
commitd41a4b118be039408d74f1f2eda4767d42c0b00b (patch)
tree3a96e007979053b04605c287829d504b9b99c503 /src/account
parent8ef9b8fb289d287f7000c5c9f30568f76e0de94a (diff)
downloadopenlmi-providers-d41a4b118be039408d74f1f2eda4767d42c0b00b.tar.gz
openlmi-providers-d41a4b118be039408d74f1f2eda4767d42c0b00b.tar.xz
openlmi-providers-d41a4b118be039408d74f1f2eda4767d42c0b00b.zip
indicationmanager: Handle EOF in inotify read
Diffstat (limited to 'src/account')
-rw-r--r--src/account/indication_common.c6
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) {