*/
#include "includes.h"
+#include "smbd/smbd.h"
+#include "librpc/gen_ndr/notify.h"
#include <fam.h>
setenv("GAM_CLIENT_ID","SAMBA",0);
#endif
- if (asprintf(&name, "smbd (%lu)", (unsigned long)sys_getpid()) == -1) {
+ if (asprintf(&name, "smbd (%lu)", (unsigned long)getpid()) == -1) {
DEBUG(0, ("No memory\n"));
return NT_STATUS_NO_MEMORY;
}
*/
static NTSTATUS fam_watch(vfs_handle_struct *vfs_handle,
struct sys_notify_context *ctx,
- struct notify_entry *e,
+ const char *path,
+ uint32_t *filter,
+ uint32_t *subdir_filter,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
struct fam_watch_context *watch;
void **handle = (void **)handle_p;
- if ((e->filter & fam_mask) == 0) {
- DEBUG(10, ("filter = %u, ignoring in FAM\n", e->filter));
+ if ((*filter & fam_mask) == 0) {
+ DEBUG(10, ("filter = %u, ignoring in FAM\n", *filter));
return NT_STATUS_OK;
}
fam_connection_initialized = True;
}
- if (!(watch = TALLOC_P(ctx, struct fam_watch_context))) {
+ if (!(watch = talloc(ctx, struct fam_watch_context))) {
return NT_STATUS_NO_MEMORY;
}
watch->private_data = private_data;
watch->sys_ctx = ctx;
- if (!(watch->path = talloc_strdup(watch, e->path))) {
+ watch->path = talloc_strdup(watch, path);
+ if (watch->path == NULL) {
DEBUG(0, ("talloc_asprintf failed\n"));
TALLOC_FREE(watch);
return NT_STATUS_NO_MEMORY;
*/
watch->filter = fam_mask;
- e->filter &= ~fam_mask;
+ *filter &= ~fam_mask;
DLIST_ADD(fam_notify_list, watch);
talloc_set_destructor(watch, fam_watch_context_destructor);
/* VFS operations structure */
static struct vfs_fn_pointers notify_fam_fns = {
- .notify_watch = fam_watch,
+ .notify_watch_fn = fam_watch,
};