libdlog: fix a dynamic config crash 07/193107/1
authorMichal Bloch <m.bloch@samsung.com>
Wed, 14 Nov 2018 15:09:59 +0000 (16:09 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Wed, 14 Nov 2018 15:09:59 +0000 (16:09 +0100)
Change-Id: I83867775088438636cf483a14616b8ef49106a84
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/libdlog/dynamic_config.c

index a89439c..ce91639 100644 (file)
@@ -138,7 +138,11 @@ void __dynamic_config_update()
        const int r = read(inotify_fd, &ievent, sizeof ievent);
        if (r < 0)
                return;
-       assert(ievent.ie.wd == inotify_wd);
+
+       /* -1 means an overflow of the the event queue. This is fine
+          (if a bit worrisome) since it still tells us that an event
+          has arrived, which is all we care about at this point. */
+       assert(ievent.ie.wd == inotify_wd || ievent.ie.wd == -1);
 
        pthread_mutex_lock(&log_init_lock);
        __apply_update();