summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-11-05 11:44:42 +0000
committerJeremy Allison <jra@samba.org>2014-12-09 04:12:09 +0100
commitde4a1c90a70b31f99e987fa109683862bd0823d1 (patch)
tree8f5b82f01431fcd39a301fc45c883fa9cebb70a9 /source4
parentf530d6d97bfb7c64ede37ad8d2ee33118ddcf3d1 (diff)
downloadsamba-de4a1c90a70b31f99e987fa109683862bd0823d1.tar.gz
notify: Add "dir" to notify_event
"notify_event" only reports names relative to some path that is only implicitly known via "private_data". Right now "private_data" is the fsp of the directory holding this notify. I want to use inotify_watch in a notify-daemon that does not have a fsp available and has more problems getting the path right out of "private_data". notify_inotify has the directory under which the event happened available, so make it known to the callback. Right now no caller uses it yet. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/common/notify.c1
-rw-r--r--source4/ntvfs/sysdep/inotify.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c
index 57142c7f38c..61da0b8291d 100644
--- a/source4/ntvfs/common/notify.c
+++ b/source4/ntvfs/common/notify.c
@@ -550,6 +550,7 @@ static void notify_send(struct notify_context *notify, struct notify_entry *e,
TALLOC_CTX *tmp_ctx;
ev.action = action;
+ ev.dir = discard_const_p(char, "");
ev.path = path;
ev.private_data = e->private_data;
diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c
index 0680b4b52bf..091ca1da283 100644
--- a/source4/ntvfs/sysdep/inotify.c
+++ b/source4/ntvfs/sysdep/inotify.c
@@ -144,6 +144,7 @@ static void inotify_dispatch(struct inotify_private *in,
for (w=in->watches;w;w=next) {
next = w->next;
if (w->wd == e->wd && filter_match(w, e)) {
+ ne.dir = w->path;
w->callback(in->ctx, w->private_data, &ne);
}
}
@@ -163,6 +164,7 @@ static void inotify_dispatch(struct inotify_private *in,
next = w->next;
if (w->wd == e->wd && filter_match(w, e) &&
!(w->filter & FILE_NOTIFY_CHANGE_CREATION)) {
+ ne.dir = w->path;
w->callback(in->ctx, w->private_data, &ne);
}
}