aboutsummaryrefslogtreecommitdiff
path: root/src/direvent.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-08-12 14:34:08 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-08-12 14:34:08 +0300
commitaff5ae79c0ccf6b38d55a4b86fb1c851b57c62e6 (patch)
tree77aacb3c737663ef58a5cc0362fb8c159ac54d8a /src/direvent.h
parent1c3d624491a755f72c6ec61a1b4269487c257f05 (diff)
downloaddirevent-aff5ae79c0ccf6b38d55a4b86fb1c851b57c62e6.tar.gz
direvent-aff5ae79c0ccf6b38d55a4b86fb1c851b57c62e6.tar.bz2
Don't keep watchpoint descriptor table
During the lifetime of a watcher, its descriptor can change, so it cannot be reliably used to identify the watcher outside of the ev_*.c module. E.g. for kqueue interface, descriptors change after compacting the event table, which happens when a watcher is closed and removed. Finding the watcher for the given event is now the responsibility of the event module. * src/direvent.h (dirwatcher_ref) (dirwatcher_unref): New protos. (dirwatcher_lookup_wd): Remove. * src/watcher.c (dirwatcher_ref): New function. (dirwatcher_register, dirwatcher_lookup_wd) (dirwatcher_remove_wd): Remove. All uses updated. (setwatcher): Indicate successful initialization for the caller. (setup_watchers): Check success flag. * src/ev_inotify.c (dwreg, dwunreg) (dwget): New functions to keep track of the registered watchers and their descriptors. (sysev_add_watch): Register watcher. (sysev_rm_watch): Deregister it. * src/ev_kqueue.c (check_created): Skip directory entries that don't match pattern.
Diffstat (limited to 'src/direvent.h')
-rw-r--r--src/direvent.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/direvent.h b/src/direvent.h
index 1810001..0f1dc92 100644
--- a/src/direvent.h
+++ b/src/direvent.h
@@ -206,9 +206,11 @@ void config_parse(const char *file);
int get_facility(const char *arg);
int get_priority(const char *arg);
+void dirwatcher_ref(struct dirwatcher *dw);
+void dirwatcher_unref(struct dirwatcher *dw);
+
void setup_watchers(void);
struct dirwatcher *dirwatcher_lookup(const char *dirname);
-struct dirwatcher *dirwatcher_lookup_wd(int wd);
int check_new_watcher(const char *dir, const char *name);
struct dirwatcher *dirwatcher_install(const char *path, int *pnew);
void dirwatcher_destroy(struct dirwatcher *dwp);

Return to:

Send suggestions and report system problems to the System administrator.