Alexandre Julliard : server: Use sys/inotify. h if it exists instead of hardcoding the system calls.

Alexandre Julliard julliard at winehq.org
Fri Jun 26 09:47:21 CDT 2009


Module: wine
Branch: master
Commit: 61a70360e61df478b0500f5212ada9414eef67b7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=61a70360e61df478b0500f5212ada9414eef67b7

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jun 26 15:45:03 2009 +0200

server: Use sys/inotify.h if it exists instead of hardcoding the system calls.

---

 configure           |    2 ++
 configure.ac        |    1 +
 include/config.h.in |    3 +++
 server/change.c     |    9 ++++++---
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index a6b0a60..0af4b6b 100755
--- a/configure
+++ b/configure
@@ -5740,6 +5740,7 @@ done
 
 
 
+
 for ac_header in \
 	AudioUnit/AudioUnit.h \
 	Carbon/Carbon.h \
@@ -5824,6 +5825,7 @@ for ac_header in \
 	sys/event.h \
 	sys/exec_elf.h \
 	sys/filio.h \
+	sys/inotify.h \
 	sys/ioctl.h \
 	sys/ipc.h \
 	sys/limits.h \
diff --git a/configure.ac b/configure.ac
index 60bd78e..c696cb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,6 +347,7 @@ AC_CHECK_HEADERS(\
 	sys/event.h \
 	sys/exec_elf.h \
 	sys/filio.h \
+	sys/inotify.h \
 	sys/ioctl.h \
 	sys/ipc.h \
 	sys/limits.h \
diff --git a/include/config.h.in b/include/config.h.in
index b2642c9..e12aa1a 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -828,6 +828,9 @@
 /* Define to 1 if you have the <sys/filio.h> header file. */
 #undef HAVE_SYS_FILIO_H
 
+/* Define to 1 if you have the <sys/inotify.h> header file. */
+#undef HAVE_SYS_INOTIFY_H
+
 /* Define to 1 if you have the <sys/ioctl.h> header file. */
 #undef HAVE_SYS_IOCTL_H
 
diff --git a/server/change.c b/server/change.c
index 63985f4..773fa1c 100644
--- a/server/change.c
+++ b/server/change.c
@@ -65,7 +65,10 @@
 
 /* inotify support */
 
-#if defined(__linux__) && defined(__i386__)
+#ifdef HAVE_SYS_INOTIFY_H
+#include <sys/inotify.h>
+#define USE_INOTIFY
+#elif defined(__linux__) && defined(__i386__)
 
 #define SYS_inotify_init	291
 #define SYS_inotify_add_watch	292
@@ -114,7 +117,7 @@ static inline int inotify_add_watch( int fd, const char *name, unsigned int mask
     return ret;
 }
 
-static inline int inotify_remove_watch( int fd, int wd )
+static inline int inotify_rm_watch( int fd, int wd )
 {
     int ret;
     __asm__ __volatile__( "pushl %%ebx;\n\t"
@@ -568,7 +571,7 @@ static void free_inode( struct inode *inode )
 
     if (inode->wd != -1)
     {
-        inotify_remove_watch( get_unix_fd( inotify_fd ), inode->wd );
+        inotify_rm_watch( get_unix_fd( inotify_fd ), inode->wd );
         list_remove( &inode->wd_entry );
     }
     list_remove( &inode->ino_entry );




More information about the wine-cvs mailing list