mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-14 11:33:14 +00:00
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?
(cherry picked from commit 085c39d394
)
This commit is contained in:
parent
c2c58cd8d7
commit
8be18483e3
10
src/conky.cc
10
src/conky.cc
@ -2299,10 +2299,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 */
|
||||
|
Loading…
Reference in New Issue
Block a user