Changeset 988 for vendor/current/source4/ntvfs/sysdep
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/ntvfs/sysdep
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/ntvfs/sysdep/inotify.c
r414 r988 30 30 #include "param/param.h" 31 31 32 #if HAVE_SYS_INOTIFY_H33 32 #include <sys/inotify.h> 34 #else 35 /* for older glibc varients - we can remove this eventually */ 36 #include <linux/inotify.h> 37 #include <asm/unistd.h> 38 39 #ifndef HAVE_INOTIFY_INIT 40 /* 41 glibc doesn't define these functions yet (as of March 2006) 42 */ 43 static int inotify_init(void) 44 { 45 return syscall(__NR_inotify_init); 46 } 47 48 static int inotify_add_watch(int fd, const char *path, __u32 mask) 49 { 50 return syscall(__NR_inotify_add_watch, fd, path, mask); 51 } 52 53 static int inotify_rm_watch(int fd, int wd) 54 { 55 return syscall(__NR_inotify_rm_watch, fd, wd); 56 } 57 #endif 58 #endif 59 60 61 /* older glibc headers don't have these defines either */ 33 34 /* glibc < 2.5 headers don't have these defines */ 62 35 #ifndef IN_ONLYDIR 63 36 #define IN_ONLYDIR 0x01000000 … … 172 145 next = w->next; 173 146 if (w->wd == e->wd && filter_match(w, e)) { 147 ne.dir = w->path; 174 148 w->callback(in->ctx, w->private_data, &ne); 175 149 } … … 191 165 if (w->wd == e->wd && filter_match(w, e) && 192 166 !(w->filter & FILE_NOTIFY_CHANGE_CREATION)) { 167 ne.dir = w->path; 193 168 w->callback(in->ctx, w->private_data, &ne); 194 169 } … … 259 234 DEBUG(0,("Failed to init inotify - %s\n", strerror(errno))); 260 235 talloc_free(in); 261 return map_nt_error_from_unix (errno);236 return map_nt_error_from_unix_common(errno); 262 237 } 263 238 in->ctx = ctx; … … 275 250 DEBUG(0,("Failed to tevent_add_fd() - %s\n", strerror(errno))); 276 251 talloc_free(in); 277 return map_nt_error_from_unix (errno);252 return map_nt_error_from_unix_common(errno); 278 253 } 279 254 … … 374 349 if (wd == -1) { 375 350 e->filter = filter; 376 return map_nt_error_from_unix (errno);351 return map_nt_error_from_unix_common(errno); 377 352 } 378 353 … … 416 391 initialialise the inotify module 417 392 */ 393 NTSTATUS sys_notify_inotify_init(void); 418 394 NTSTATUS sys_notify_inotify_init(void) 419 395 { -
vendor/current/source4/ntvfs/sysdep/sys_lease.c
r740 r988 28 28 #include "../lib/util/dlinklist.h" 29 29 #include "param/param.h" 30 #include "lib/util/samba_modules.h" 30 31 31 32 /* list of registered backends */ … … 41 42 TALLOC_CTX *mem_ctx, 42 43 struct tevent_context *ev, 43 struct messaging_context *msg,44 struct imessaging_context *msg, 44 45 sys_lease_send_break_fn break_send) 45 46 { … … 48 49 int i; 49 50 NTSTATUS status; 51 TALLOC_CTX * tmp_ctx; 50 52 51 53 if (num_backends == 0) { … … 62 64 } 63 65 66 tmp_ctx = talloc_new(ctx); 67 if (tmp_ctx == NULL) { 68 return NULL; 69 } 70 64 71 ctx->event_ctx = ev; 65 72 ctx->msg_ctx = msg; 66 73 ctx->break_send = break_send; 67 74 68 bname = share_string_option( scfg, LEASE_BACKEND, NULL);75 bname = share_string_option(tmp_ctx, scfg, LEASE_BACKEND, NULL); 69 76 if (!bname) { 70 77 talloc_free(ctx); … … 90 97 } 91 98 99 TALLOC_FREE(tmp_ctx); 92 100 return ctx; 93 101 } -
vendor/current/source4/ntvfs/sysdep/sys_lease.h
r414 r988 22 22 struct sys_lease_context; 23 23 struct opendb_entry; 24 struct messaging_context;24 struct imessaging_context; 25 25 struct tevent_context; 26 26 27 typedef NTSTATUS (*sys_lease_send_break_fn)(struct messaging_context *,27 typedef NTSTATUS (*sys_lease_send_break_fn)(struct imessaging_context *, 28 28 struct opendb_entry *, 29 29 uint8_t level); … … 42 42 struct sys_lease_context { 43 43 struct tevent_context *event_ctx; 44 struct messaging_context *msg_ctx;44 struct imessaging_context *msg_ctx; 45 45 sys_lease_send_break_fn break_send; 46 46 void *private_data; /* for use of backend */ … … 54 54 TALLOC_CTX *mem_ctx, 55 55 struct tevent_context *ev, 56 struct messaging_context *msg_ctx,56 struct imessaging_context *msg_ctx, 57 57 sys_lease_send_break_fn break_send); 58 58 -
vendor/current/source4/ntvfs/sysdep/sys_lease_linux.c
r414 r988 30 30 #include "../lib/util/dlinklist.h" 31 31 #include "cluster/cluster.h" 32 33 NTSTATUS sys_lease_linux_init(void); 32 34 33 35 #define LINUX_LEASE_RT_SIGNAL (SIGRTMIN+1) … … 130 132 if (ret == -1) { 131 133 talloc_free(p); 132 return map_nt_error_from_unix (errno);134 return map_nt_error_from_unix_common(errno); 133 135 } 134 136 … … 136 138 if (ret == -1) { 137 139 talloc_free(p); 138 return map_nt_error_from_unix (errno);140 return map_nt_error_from_unix_common(errno); 139 141 } 140 142 -
vendor/current/source4/ntvfs/sysdep/sys_notify.c
r740 r988 29 29 #include "../lib/util/dlinklist.h" 30 30 #include "param/param.h" 31 #include "lib/util/samba_modules.h" 31 32 32 33 /* list of registered backends */ … … 62 63 ctx->ev = ev; 63 64 64 bname = share_string_option( scfg, NOTIFY_BACKEND, NULL);65 bname = share_string_option(ctx, scfg, NOTIFY_BACKEND, NULL); 65 66 if (!bname) { 66 67 if (num_backends) { -
vendor/current/source4/ntvfs/sysdep/sys_notify.h
r740 r988 18 18 */ 19 19 20 #include "librpc/gen_ndr/ s4_notify.h"20 #include "librpc/gen_ndr/notify.h" 21 21 #include "param/share.h" 22 22 -
vendor/current/source4/ntvfs/sysdep/wscript_build
r740 r988 5 5 subsystem='sys_notify', 6 6 init_function='sys_notify_inotify_init', 7 deps='events ',7 deps='events inotify', 8 8 enabled = bld.CONFIG_SET('HAVE_LINUX_INOTIFY') 9 9 ) -
vendor/current/source4/ntvfs/sysdep/wscript_configure
r740 r988 1 1 #!/usr/bin/env python 2 2 3 conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h', add_headers=False) 3 import sys 4 4 5 conf.CHECK_FUNCS('inotify_init') 5 # Check for inotify support (Skip if we are SunOS) 6 #NOTE: illumos provides sys/inotify.h but is not an exact match for linux 7 host_os = sys.platform 8 if host_os.rfind('sunos') == -1: 9 conf.CHECK_HEADERS('sys/inotify.h', add_headers=False) 10 if (conf.CONFIG_SET('HAVE_SYS_INOTIFY_H')): 11 conf.DEFINE('HAVE_LINUX_INOTIFY', 1) 6 12 7 conf.CHECK_VARIABLE('__NR_inotify_init')8 13 conf.CHECK_DECLS('F_SETLEASE', headers='linux/fcntl.h', reverse=True) 9 14 conf.CHECK_DECLS('SA_SIGINFO', headers='signal.h', reverse=True) 10 11 conf.CHECK_DECLS('__NR_inotify_init', reverse=True, headers='asm/unistd.h')12 13 if (conf.CONFIG_SET('HAVE___NR_INOTIFY_INIT') and14 (conf.CONFIG_SET('HAVE_LINUX_INOTIFY_H') or15 conf.CONFIG_SET('HAVE_SYS_INOTIFY_H'))):16 conf.DEFINE('HAVE_LINUX_INOTIFY', 1)
Note:
See TracChangeset
for help on using the changeset viewer.