mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
Merge pull request #22 from adeason/inotifyfd
Set uninitialized inotify_fd to -1, not 0
This commit is contained in:
commit
b37f0493be
@ -2017,7 +2017,7 @@ static void update_text(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SYS_INOTIFY_H
|
#ifdef HAVE_SYS_INOTIFY_H
|
||||||
int inotify_fd;
|
int inotify_fd = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void main_loop(void)
|
static void main_loop(void)
|
||||||
@ -2484,7 +2484,7 @@ static void main_loop(void)
|
|||||||
} else if (disable_auto_reload.get(*state) && inotify_fd != -1) {
|
} else if (disable_auto_reload.get(*state) && inotify_fd != -1) {
|
||||||
inotify_rm_watch(inotify_fd, inotify_config_wd);
|
inotify_rm_watch(inotify_fd, inotify_config_wd);
|
||||||
close(inotify_fd);
|
close(inotify_fd);
|
||||||
inotify_fd = inotify_config_wd = 0;
|
inotify_fd = inotify_config_wd = -1;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SYS_INOTIFY_H */
|
#endif /* HAVE_SYS_INOTIFY_H */
|
||||||
|
|
||||||
@ -2497,7 +2497,7 @@ static void main_loop(void)
|
|||||||
if (inotify_fd != -1) {
|
if (inotify_fd != -1) {
|
||||||
inotify_rm_watch(inotify_fd, inotify_config_wd);
|
inotify_rm_watch(inotify_fd, inotify_config_wd);
|
||||||
close(inotify_fd);
|
close(inotify_fd);
|
||||||
inotify_fd = inotify_config_wd = 0;
|
inotify_fd = inotify_config_wd = -1;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SYS_INOTIFY_H */
|
#endif /* HAVE_SYS_INOTIFY_H */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user