summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-25 12:52:55 +0100
committerVolker Lendecke <vl@samba.org>2008-02-25 12:57:41 +0100
commit51f315065bfccc155aa19feaf5b65110b639f8d1 (patch)
tree86f9fe2c9b06511448c24d462791345c58bc6857
parent81b392b353b0d4812adc0ee8c767251a5bd738e4 (diff)
downloadsamba-51f315065bfccc155aa19feaf5b65110b639f8d1.tar.gz
Fix inotify detection
Bug 5271 -- thanks to Tiziano Müller
-rw-r--r--source/configure.in2
-rw-r--r--source/smbd/notify_inotify.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/source/configure.in b/source/configure.in
index d3fb63bb537..9c31de4bf3b 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -2541,7 +2541,7 @@ fi
AC_CACHE_CHECK([for inotify support],samba_cv_HAVE_INOTIFY,[
AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h)
-AC_CHECK_FUNC(inotify_init)
+AC_CHECK_FUNCS(inotify_init)
AC_HAVE_DECL(__NR_inotify_init, [#include <asm/unistd.h>])
],
samba_cv_HAVE_INOTIFY=yes,
diff --git a/source/smbd/notify_inotify.c b/source/smbd/notify_inotify.c
index 1b1bad7e966..a9eb221cb9c 100644
--- a/source/smbd/notify_inotify.c
+++ b/source/smbd/notify_inotify.c
@@ -30,10 +30,12 @@
#include <asm/types.h>
#endif
+#ifndef HAVE_INOTIFY_INIT
+
#include <linux/inotify.h>
#include <asm/unistd.h>
-#ifndef HAVE_INOTIFY_INIT
+
/*
glibc doesn't define these functions yet (as of March 2006)
*/
@@ -51,6 +53,10 @@ static int inotify_rm_watch(int fd, int wd)
{
return syscall(__NR_inotify_rm_watch, fd, wd);
}
+#else
+
+#include <sys/inotify.h>
+
#endif