use glibc sys/inotify.h header
authorAndrew Tridgell <tridge@samba.org>
Thu, 30 Oct 2008 19:32:06 +0000 (12:32 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 30 Oct 2008 19:32:06 +0000 (12:32 -0700)
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

source/configure.in
source/smbd/notify_inotify.c

index f28da357dbe4df2c647b20d1276d622c29c829c8..5a3abd0b859d084a89ec984aa59bdb5ab22f0455 100644 (file)
@@ -2473,7 +2473,7 @@ if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
 fi
 
 AC_CACHE_CHECK([for inotify support],samba_cv_HAVE_INOTIFY,[
-AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h)
+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>])
 ],
index c6c12a9cd2d02dc82467aafd0de06f51fa37cf97..8237e4ab0bcf808eaea426b4c1324ba44e52f61a 100644 (file)
 
 #ifdef HAVE_INOTIFY
 
+#if HAVE_SYS_INOTIFY_H
+#include <sys/inotify.h>
+#else
+
 #ifdef HAVE_ASM_TYPES_H
 #include <asm/types.h>
 #endif
@@ -57,7 +61,7 @@ static int inotify_rm_watch(int fd, int wd)
 #include <sys/inotify.h>
 
 #endif
-
+#endif
 
 /* older glibc headers don't have these defines either */
 #ifndef IN_ONLYDIR