server: Use sys/inotify.h if it exists instead of hardcoding the system calls.
This commit is contained in:
parent
6a392a8aa9
commit
61a70360e6
|
@ -5738,6 +5738,7 @@ done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_header in \
|
for ac_header in \
|
||||||
|
@ -5824,6 +5825,7 @@ for ac_header in \
|
||||||
sys/event.h \
|
sys/event.h \
|
||||||
sys/exec_elf.h \
|
sys/exec_elf.h \
|
||||||
sys/filio.h \
|
sys/filio.h \
|
||||||
|
sys/inotify.h \
|
||||||
sys/ioctl.h \
|
sys/ioctl.h \
|
||||||
sys/ipc.h \
|
sys/ipc.h \
|
||||||
sys/limits.h \
|
sys/limits.h \
|
||||||
|
|
|
@ -347,6 +347,7 @@ AC_CHECK_HEADERS(\
|
||||||
sys/event.h \
|
sys/event.h \
|
||||||
sys/exec_elf.h \
|
sys/exec_elf.h \
|
||||||
sys/filio.h \
|
sys/filio.h \
|
||||||
|
sys/inotify.h \
|
||||||
sys/ioctl.h \
|
sys/ioctl.h \
|
||||||
sys/ipc.h \
|
sys/ipc.h \
|
||||||
sys/limits.h \
|
sys/limits.h \
|
||||||
|
|
|
@ -828,6 +828,9 @@
|
||||||
/* Define to 1 if you have the <sys/filio.h> header file. */
|
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||||
#undef HAVE_SYS_FILIO_H
|
#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. */
|
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||||
#undef HAVE_SYS_IOCTL_H
|
#undef HAVE_SYS_IOCTL_H
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,10 @@
|
||||||
|
|
||||||
/* inotify support */
|
/* 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_init 291
|
||||||
#define SYS_inotify_add_watch 292
|
#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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int inotify_remove_watch( int fd, int wd )
|
static inline int inotify_rm_watch( int fd, int wd )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
__asm__ __volatile__( "pushl %%ebx;\n\t"
|
__asm__ __volatile__( "pushl %%ebx;\n\t"
|
||||||
|
@ -568,7 +571,7 @@ static void free_inode( struct inode *inode )
|
||||||
|
|
||||||
if (inode->wd != -1)
|
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->wd_entry );
|
||||||
}
|
}
|
||||||
list_remove( &inode->ino_entry );
|
list_remove( &inode->ino_entry );
|
||||||
|
|
Loading…
Reference in New Issue