git.samba.org
/
sfrench
/
samba-autobuild
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *)
[sfrench/samba-autobuild/.git]
/
source4
/
ntvfs
/
sysdep
/
sys_notify.c
diff --git
a/source4/ntvfs/sysdep/sys_notify.c
b/source4/ntvfs/sysdep/sys_notify.c
index c628b9068cb8d31510dab9d48ba0dc629166f6bd..aad3b900dd17c9014798f1e98d42d498670f7882 100644
(file)
--- a/
source4/ntvfs/sysdep/sys_notify.c
+++ b/
source4/ntvfs/sysdep/sys_notify.c
@@
-25,9
+25,10
@@
#include "includes.h"
#include "system/filesys.h"
#include "ntvfs/sysdep/sys_notify.h"
#include "includes.h"
#include "system/filesys.h"
#include "ntvfs/sysdep/sys_notify.h"
-#include
"lib/events/events.h"
-#include "lib/util/dlinklist.h"
+#include
<tevent.h>
+#include "
../
lib/util/dlinklist.h"
#include "param/param.h"
#include "param/param.h"
+#include "lib/util/samba_modules.h"
/* list of registered backends */
static struct sys_notify_backend *backends;
/* list of registered backends */
static struct sys_notify_backend *backends;
@@
-40,7
+41,7
@@
static uint32_t num_backends;
*/
_PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_config *scfg,
TALLOC_CTX *mem_ctx,
*/
_PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_config *scfg,
TALLOC_CTX *mem_ctx,
- struct event_context *ev)
+ struct
t
event_context *ev)
{
struct sys_notify_context *ctx;
const char *bname;
{
struct sys_notify_context *ctx;
const char *bname;
@@
-51,7
+52,7
@@
_PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_confi
}
if (ev == NULL) {
}
if (ev == NULL) {
-
ev = event_context_find(mem_ctx)
;
+
return NULL
;
}
ctx = talloc_zero(mem_ctx, struct sys_notify_context);
}
ctx = talloc_zero(mem_ctx, struct sys_notify_context);
@@
-61,7
+62,7
@@
_PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_confi
ctx->ev = ev;
ctx->ev = ev;
- bname = share_string_option(scfg, NOTIFY_BACKEND, NULL);
+ bname = share_string_option(
ctx,
scfg, NOTIFY_BACKEND, NULL);
if (!bname) {
if (num_backends) {
bname = backends[0].name;
if (!bname) {
if (num_backends) {
bname = backends[0].name;
@@
-71,6
+72,17
@@
_PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_confi
}
for (i=0;i<num_backends;i++) {
}
for (i=0;i<num_backends;i++) {
+ char *enable_opt_name;
+ bool enabled;
+
+ enable_opt_name = talloc_asprintf(mem_ctx, "notify:%s",
+ backends[i].name);
+ enabled = share_bool_option(scfg, enable_opt_name, true);
+ talloc_free(enable_opt_name);
+
+ if (!enabled)
+ continue;
+
if (strcasecmp(backends[i].name, bname) == 0) {
bname = backends[i].name;
break;
if (strcasecmp(backends[i].name, bname) == 0) {
bname = backends[i].name;
break;
@@
-123,14
+135,14
@@
_PUBLIC_ NTSTATUS sys_notify_register(struct sys_notify_backend *backend)
_PUBLIC_ NTSTATUS sys_notify_init(void)
{
static bool initialized = false;
_PUBLIC_ NTSTATUS sys_notify_init(void)
{
static bool initialized = false;
-
extern NTSTATUS sys_notify_inotify_init(void
);
-
+
#define _MODULE_PROTO(init) extern NTSTATUS init(TALLOC_CTX *
);
+ STATIC_sys_notify_MODULES_PROTO;
init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
if (initialized) return NT_STATUS_OK;
initialized = true;
init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
if (initialized) return NT_STATUS_OK;
initialized = true;
- run_init_functions(static_init);
+ run_init_functions(
NULL,
static_init);
return NT_STATUS_OK;
}
return NT_STATUS_OK;
}