From 085c39d39464642746a1883266d9dffcfc10e84c Mon Sep 17 00:00:00 2001 From: Cesare Tirabassi Date: Mon, 22 Feb 2010 22:45:51 +0100 Subject: [PATCH] Fix LP: #525926; conky sigsegv if config file is deleted Basically, we only relod if the file is modified but still handle the case where the watch gets lost. Maybe we should just ignore IN_IGNORE altogether? --- src/conky.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/conky.c b/src/conky.c index fbf9272..9f503c3 100644 --- a/src/conky.c +++ b/src/conky.c @@ -3915,10 +3915,12 @@ static void main_loop(void) len = read(inotify_fd, inotify_buff, INOTIFY_BUF_LEN); while (len > 0 && idx < len) { struct inotify_event *ev = (struct inotify_event *) &inotify_buff[idx]; - if (ev->wd == inotify_config_wd && (ev->mask & IN_MODIFY || ev->mask & IN_IGNORED)) { - /* current_config should be reloaded */ - NORM_ERR("'%s' modified, reloading...", current_config); - reload_config(); + if (ev->wd == inotify_config_wd) { + if (ev->mask & IN_MODIFY) { + /* current_config should be reloaded */ + NORM_ERR("'%s' modified, reloading...", current_config); + reload_config(); + } if (ev->mask & IN_IGNORED) { /* for some reason we get IN_IGNORED here * sometimes, so we need to re-add the watch */ -- 1.7.9.5