diff options
author | Jeremy Allison <jra@samba.org> | 2017-05-11 15:50:08 -0700 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2017-05-13 16:50:13 +0200 |
commit | 6f05597f5f02c2ad2b01a66e3b3b4625c6f05021 (patch) | |
tree | d4750b12af6aa55917c817f248aeb9188e968f71 /source4/ntvfs | |
parent | f0d8913a0f795657200c18807bd3855eef5fb6e0 (diff) | |
download | samba-6f05597f5f02c2ad2b01a66e3b3b4625c6f05021.tar.gz |
s4: ntvfs: Add a TALLOC_CTX * to sys_notify_register().
Pass in the TALLOC_CTX * from the module init to remove
another talloc_autofree_context() use.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/sysdep/inotify.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/sysdep/sys_notify.c | 5 | ||||
-rw-r--r-- | source4/ntvfs/sysdep/sys_notify.h | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c index c769618cf42..ba4b336c44e 100644 --- a/source4/ntvfs/sysdep/inotify.c +++ b/source4/ntvfs/sysdep/inotify.c @@ -394,5 +394,5 @@ NTSTATUS sys_notify_inotify_init(TALLOC_CTX *); NTSTATUS sys_notify_inotify_init(TALLOC_CTX *ctx) { /* register ourselves as a system inotify module */ - return sys_notify_register(&inotify); + return sys_notify_register(ctx, &inotify); } diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c index aad3b900dd1..7e00032959a 100644 --- a/source4/ntvfs/sysdep/sys_notify.c +++ b/source4/ntvfs/sysdep/sys_notify.c @@ -120,10 +120,11 @@ _PUBLIC_ NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, /* register a notify backend */ -_PUBLIC_ NTSTATUS sys_notify_register(struct sys_notify_backend *backend) +_PUBLIC_ NTSTATUS sys_notify_register(TALLOC_CTX *ctx, + struct sys_notify_backend *backend) { struct sys_notify_backend *b; - b = talloc_realloc(talloc_autofree_context(), backends, + b = talloc_realloc(ctx, backends, struct sys_notify_backend, num_backends+1); NT_STATUS_HAVE_NO_MEMORY(b); backends = b; diff --git a/source4/ntvfs/sysdep/sys_notify.h b/source4/ntvfs/sysdep/sys_notify.h index d912a9bdaf6..9e10f1446bf 100644 --- a/source4/ntvfs/sysdep/sys_notify.h +++ b/source4/ntvfs/sysdep/sys_notify.h @@ -43,7 +43,8 @@ struct sys_notify_backend { notify_watch_t notify_watch; }; -NTSTATUS sys_notify_register(struct sys_notify_backend *backend); +NTSTATUS sys_notify_register(TALLOC_CTX *ctx, + struct sys_notify_backend *backend); struct sys_notify_context *sys_notify_context_create(struct share_config *scfg, TALLOC_CTX *mem_ctx, struct tevent_context *ev); |