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

source3/configure.in
source3/smbd/notify_inotify.c

index a37e97c9da60465e811b807e8fc7a83ca64b9e2c..a59fe32aff17d82226f0a19384aecd7dae09d502 100644 (file)
@@ -2489,7 +2489,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