Wojtek Dziewięcki 2013-10-02 14:49:11 +00:00 committed by Git OBS Bridge
parent c709fe0c1f
commit 6f8e460ea4

View File

@ -1,42 +0,0 @@
diff --git a/src/cron.c b/src/cron.c
index 7dc2958..69261c1 100644
--- a/src/cron.c
+++ b/src/cron.c
@@ -87,22 +87,21 @@ void set_cron_watched(int fd) {
for (i = 0; i < sizeof (wd) / sizeof (wd[0]); ++i) {
int w;
- if (open(watchpaths[i], O_RDONLY | O_NONBLOCK, 0) != -1) {
- w = inotify_add_watch(fd, watchpaths[i],
- IN_CREATE | IN_CLOSE_WRITE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO |
- IN_MOVED_FROM | IN_MOVE_SELF | IN_DELETE | IN_DELETE_SELF);
- if (w < 0) {
- if (wd[i] != -1) {
- log_it("CRON", pid, "This directory or file can't be watched",
- watchpaths[i], errno);
- log_it("CRON", pid, "INFO", "running without inotify support", 0);
- }
- inotify_enabled = 0;
- set_cron_unwatched(fd);
- return;
+ w = inotify_add_watch(fd, watchpaths[i],
+ IN_CREATE | IN_CLOSE_WRITE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO |
+ IN_MOVED_FROM | IN_MOVE_SELF | IN_DELETE | IN_DELETE_SELF);
+ if (w < 0) {
+ if (wd[i] != -1) {
+ log_it("CRON", pid, "This directory or file can't be watched",
+ watchpaths[i], errno);
+ log_it("CRON", pid, "INFO", "running without inotify support",
+ 0);
}
- wd[i] = w;
+ inotify_enabled = 0;
+ set_cron_unwatched(fd);
+ return;
}
+ wd[i] = w;
}
if (!inotify_enabled) {