diff options
| author | Volker Lendecke <vl@samba.org> | 2014-11-05 11:44:42 +0000 |
|---|---|---|
| committer | Jeremy Allison <jra@samba.org> | 2014-12-09 04:12:09 +0100 |
| commit | de4a1c90a70b31f99e987fa109683862bd0823d1 (patch) | |
| tree | 8f5b82f01431fcd39a301fc45c883fa9cebb70a9 /source3/smbd | |
| parent | f530d6d97bfb7c64ede37ad8d2ee33118ddcf3d1 (diff) | |
| download | samba-de4a1c90a70b31f99e987fa109683862bd0823d1.tar.gz samba-de4a1c90a70b31f99e987fa109683862bd0823d1.tar.xz samba-de4a1c90a70b31f99e987fa109683862bd0823d1.zip | |
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 'source3/smbd')
| -rw-r--r-- | source3/smbd/notify_inotify.c | 2 | ||||
| -rw-r--r-- | source3/smbd/notify_internal.c | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c index ad670affcd..a3c30f1431 100644 --- a/source3/smbd/notify_inotify.c +++ b/source3/smbd/notify_inotify.c @@ -165,6 +165,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); } } @@ -184,6 +185,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); } } diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 9d54891152..9c0b1901f8 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -831,9 +831,13 @@ static void notify_handler(struct messaging_context *msg_ctx, } m = (struct notify_msg *)data->data; - e.action = m->action; - e.path = m->path; - e.private_data = m->private_data; + + e = (struct notify_event) { + .action = m->action, + .path = m->path, + .private_data = m->private_data, + .dir = discard_const_p(char, "") + }; for (listel=notify->list;listel;listel=listel->next) { if (listel->private_data == m->private_data) { |
