use glibc sys/inotify.h header
authorAndrew Tridgell <tridge@samba.org>
Thu, 30 Oct 2008 04:53:46 +0000 (15:53 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 30 Oct 2008 04:53:46 +0000 (15:53 +1100)
when we first added the inotify code glibc didn't have the inotify
functions yet. Now that it does we can use the official header and
avoid the asm/unistd.h syscall workaround

source4/ntvfs/sysdep/config.m4
source4/ntvfs/sysdep/inotify.c

index 6de75a4294140487b6150bca029a1ec424092ea9..f54f65d08dff7e111b07fd186cb62bea0d489ec0 100644 (file)
@@ -1,9 +1,13 @@
-AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h)
+AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h sys/inotify.h)
 AC_CHECK_FUNC(inotify_init)
 AC_HAVE_DECL(__NR_inotify_init, [#include <asm/unistd.h>])
 
 SMB_ENABLE(sys_notify_inotify, NO)
 
+if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_sys_inotify_h" = x"yes"; then
+    SMB_ENABLE(sys_notify_inotify, YES)
+fi
+
 if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_linux_inotify_h" = x"yes"; then
     SMB_ENABLE(sys_notify_inotify, YES)
 fi
index e4e7c446866718a034ca6f66bfe3a5020c976445..68653d60bd9393b16ac9685dec47dbd2151d4956 100644 (file)
 #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>
 
@@ -51,6 +55,7 @@ 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 */