From da1778f4458d6be61b1a1b74c18367e98d6065e0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 4 Apr 2014 15:11:51 +0000 Subject: [PATCH] smbd: Pass timespec_current through the notify_callback Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/notify.c | 5 +++-- source3/smbd/notify_internal.c | 8 +++++--- source3/smbd/proto.h | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 693418a4cc6..b8085dd6c42 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -211,11 +211,12 @@ void change_notify_reply(struct smb_request *req, notify_buf->num_changes = 0; } -static void notify_callback(void *private_data, const struct notify_event *e) +static void notify_callback(void *private_data, struct timespec when, + const struct notify_event *e) { files_struct *fsp = (files_struct *)private_data; DEBUG(10, ("notify_callback called for %s\n", fsp_str_dbg(fsp))); - notify_fsp(fsp, timespec_current(), e->action, e->path); + notify_fsp(fsp, when, e->action, e->path); } static void sys_notify_callback(struct sys_notify_context *ctx, diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 4d885651bae..69f937774f7 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -44,7 +44,7 @@ struct notify_list { struct notify_list *next, *prev; const char *path; - void (*callback)(void *, const struct notify_event *); + void (*callback)(void *, struct timespec, const struct notify_event *); void *private_data; }; @@ -194,7 +194,8 @@ static int notify_context_destructor(struct notify_context *notify) NTSTATUS notify_add(struct notify_context *notify, const char *path, uint32_t filter, uint32_t subdir_filter, - void (*callback)(void *, const struct notify_event *), + void (*callback)(void *, struct timespec, + const struct notify_event *), void *private_data) { struct notify_db_entry e; @@ -820,7 +821,8 @@ static void notify_handler(struct messaging_context *msg_ctx, for (listel=notify->list;listel;listel=listel->next) { if (listel->private_data == n->private_data) { - listel->callback(listel->private_data, n); + listel->callback(listel->private_data, + timespec_current(), n); break; } } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index d9b86b6f539..bc15f159ab5 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -552,7 +552,8 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev); NTSTATUS notify_add(struct notify_context *notify, const char *path, uint32_t filter, uint32_t subdir_filter, - void (*callback)(void *, const struct notify_event *), + void (*callback)(void *, struct timespec, + const struct notify_event *), void *private_data); NTSTATUS notify_remove(struct notify_context *notify, void *private_data); void notify_trigger(struct notify_context *notify, -- 2.34.1