The Samba-Bugzilla – Attachment 7452 Details for
Bug 8850
rely on sys/inotify.h for inotify
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Back-port for 3.6.x.
0001-rely-on-sys-inotify.h-for-inotify.patch (text/plain), 5.67 KB, created by
Jeremy Allison
on 2012-04-13 17:52:36 UTC
(
hide
)
Description:
Back-port for 3.6.x.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2012-04-13 17:52:36 UTC
Size:
5.67 KB
patch
obsolete
>From d07d7659649b74ce012c7567f01f0b2db3ef0a1a Mon Sep 17 00:00:00 2001 >From: Adrian Bunk <bunk@stusta.de> >Date: Fri, 13 Apr 2012 10:47:45 -0700 >Subject: [PATCH] rely on sys/inotify.h for inotify > >sys/inotify.h was added to glibc 2.4 in 2006. > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/configure.in | 15 ++---------- > source3/smbd/notify_inotify.c | 38 +------------------------------- > source3/wscript | 10 ++------ > source4/ntvfs/sysdep/inotify.c | 29 +----------------------- > source4/ntvfs/sysdep/wscript_configure | 11 +------- > 5 files changed, 10 insertions(+), 93 deletions(-) > >diff --git a/source3/configure.in b/source3/configure.in >index d8d3a1f..061c1b1 100644 >--- a/source3/configure.in >+++ b/source3/configure.in >@@ -2819,19 +2819,10 @@ if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then > AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes]) > fi > >-AC_CACHE_CHECK([for inotify support],samba_cv_HAVE_INOTIFY,[ >-AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h sys/inotify.h) >-AC_CHECK_FUNCS(inotify_init) >-AC_HAVE_DECL(__NR_inotify_init, [#include <asm/unistd.h>]) >-], >-samba_cv_HAVE_INOTIFY=yes, >-samba_cv_HAVE_INOTIFY=no, >-samba_cv_HAVE_INOTIFY=cross) >+AC_CHECK_HEADER(sys/inotify.h) > >-if test x"$ac_cv_func_inotify_init" = x"yes"; then >- if test x"$ac_cv_header_sys_inotify_h" = x"yes" -o x"$ac_cv_header_linux_inotify_h" = x"yes"; then >- AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel or sys has inotify support]) >- fi >+if test x"ac_cv_header_sys_inotify_h" = x"yes"; then >+ AC_DEFINE(HAVE_INOTIFY,1,[For inotify support]) > fi > > ################################################# >diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c >index bccd093..d1a51f5 100644 >--- a/source3/smbd/notify_inotify.c >+++ b/source3/smbd/notify_inotify.c >@@ -27,45 +27,9 @@ > > #ifdef HAVE_INOTIFY > >-#if HAVE_SYS_INOTIFY_H > #include <sys/inotify.h> >-#else > >-#ifdef HAVE_ASM_TYPES_H >-#include <asm/types.h> >-#endif >- >-#ifndef HAVE_INOTIFY_INIT >- >-#include <linux/inotify.h> >-#include <asm/unistd.h> >- >- >-/* >- glibc doesn't define these functions yet (as of March 2006) >-*/ >-static int inotify_init(void) >-{ >- return syscall(__NR_inotify_init); >-} >- >-static int inotify_add_watch(int fd, const char *path, __u32 mask) >-{ >- return syscall(__NR_inotify_add_watch, fd, path, mask); >-} >- >-static int inotify_rm_watch(int fd, int wd) >-{ >- return syscall(__NR_inotify_rm_watch, fd, wd); >-} >-#else >- >-#include <sys/inotify.h> >- >-#endif >-#endif >- >-/* older glibc headers don't have these defines either */ >+/* glibc < 2.5 headers don't have these defines */ > #ifndef IN_ONLYDIR > #define IN_ONLYDIR 0x01000000 > #endif >diff --git a/source3/wscript b/source3/wscript >index 0d32561..207e167 100644 >--- a/source3/wscript >+++ b/source3/wscript >@@ -157,11 +157,9 @@ long ret = splice(0,0,1,0,400,0); > conf.CHECK_DECLS('splice', reverse=True, headers='fcntl.h') > > # Check for inotify support >- conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h') >- conf.CHECK_FUNCS('inotify_init') >- if "HAVE_INOTIFY_INIT" in conf.env: >- if "HAVE_LINUX_INOTIFY_H" in conf.env or "HAVE_SYS_INOTIFY_H" in conf.env: >- conf.DEFINE('HAVE_INOTIFY', 1) >+ conf.CHECK_HEADERS('sys/inotify.h') >+ if "HAVE_SYS_INOTIFY_H" in conf.env: >+ conf.DEFINE('HAVE_INOTIFY', 1) > > # Check for kernel change notify support > conf.CHECK_CODE(''' >@@ -1222,8 +1220,6 @@ ssize_t err = posix_fadvise(0,0,0x80000,POSIX_FADV_WILLNEED); > 'SYSCONF%s' % v, > msg='Checking whether sysconf(%s) is available' % v) > >- conf.CHECK_DECLS('__NR_inotify_init', reverse=True, headers='asm/unistd.h') >- > conf.CHECK_CODE(''' > #include <sys/syscall.h> > #include <unistd.h> >diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c >index 42aac0b..fe44392 100644 >--- a/source4/ntvfs/sysdep/inotify.c >+++ b/source4/ntvfs/sysdep/inotify.c >@@ -29,36 +29,9 @@ > #include "libcli/raw/smb.h" > #include "param/param.h" > >-#if HAVE_SYS_INOTIFY_H > #include <sys/inotify.h> >-#else >-/* for older glibc varients - we can remove this eventually */ >-#include <linux/inotify.h> >-#include <asm/unistd.h> > >-#ifndef HAVE_INOTIFY_INIT >-/* >- glibc doesn't define these functions yet (as of March 2006) >-*/ >-static int inotify_init(void) >-{ >- return syscall(__NR_inotify_init); >-} >- >-static int inotify_add_watch(int fd, const char *path, __u32 mask) >-{ >- return syscall(__NR_inotify_add_watch, fd, path, mask); >-} >- >-static int inotify_rm_watch(int fd, int wd) >-{ >- return syscall(__NR_inotify_rm_watch, fd, wd); >-} >-#endif >-#endif >- >- >-/* older glibc headers don't have these defines either */ >+/* glibc < 2.5 headers don't have these defines */ > #ifndef IN_ONLYDIR > #define IN_ONLYDIR 0x01000000 > #endif >diff --git a/source4/ntvfs/sysdep/wscript_configure b/source4/ntvfs/sysdep/wscript_configure >index f1e09dd..aa63000 100644 >--- a/source4/ntvfs/sysdep/wscript_configure >+++ b/source4/ntvfs/sysdep/wscript_configure >@@ -1,16 +1,9 @@ > #!/usr/bin/env python > >-conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h', add_headers=False) >+conf.CHECK_HEADERS('sys/inotify.h', add_headers=False) > >-conf.CHECK_FUNCS('inotify_init') >- >-conf.CHECK_VARIABLE('__NR_inotify_init') > conf.CHECK_DECLS('F_SETLEASE', headers='linux/fcntl.h', reverse=True) > conf.CHECK_DECLS('SA_SIGINFO', headers='signal.h', reverse=True) > >-conf.CHECK_DECLS('__NR_inotify_init', reverse=True, headers='asm/unistd.h') >- >-if (conf.CONFIG_SET('HAVE___NR_INOTIFY_INIT') and >- (conf.CONFIG_SET('HAVE_LINUX_INOTIFY_H') or >- conf.CONFIG_SET('HAVE_SYS_INOTIFY_H'))): >+if (conf.CONFIG_SET('HAVE_SYS_INOTIFY_H')): > conf.DEFINE('HAVE_LINUX_INOTIFY', 1) >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8850
:
7441
| 7452