ecore: remove non-sys/inotify.h codepaths

sys/inotify.h was added to glibc 2.4 in 2006.

Patch by: Adrian Bunk

SVN revision: 78933
This commit is contained in:
Sebastian Dransfeld 2012-11-05 21:59:39 +00:00
parent fd2993a86f
commit e1f16731ef
2 changed files with 7 additions and 55 deletions

View File

@ -35,8 +35,8 @@ AC_DEFUN([ECORE_CHECK_INOTIFY],
_ecore_want_inotify=$1
_ecore_have_inotify="no"
dnl We need to check if the right inotify version is accessible
_ecore_want_inotify="yes"
_ecore_have_inotify="no"
AC_ARG_ENABLE(inotify,
[AC_HELP_STRING([--disable-inotify], [disable inotify in the ecore_file module])],
[
@ -47,37 +47,20 @@ AC_ARG_ENABLE(inotify,
fi
])
AC_MSG_CHECKING(whether inotify is to be used for filemonitoring)
AC_MSG_RESULT($_ecore_want_inotify)
dnl It is hard to find a good test on how to check the correct
dnl inotify version. They changed the headers a lot.
dnl in kernel 2.6.13 __NR_inotify_init was added to the defined syscalls
dnl in asm/unistd.h and IN_MOVE_SELF was added to linux/inotify.h
dnl so with this check you need a very new kernel and kernel-headers!
if test "x${_ecore_want_inotify}" = "xyes" ; then
AC_CHECK_LIB([c], [inotify_init],
AC_CHECK_HEADER([sys/inotify.h],
[
AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ])
AC_DEFINE(HAVE_SYS_INOTIFY, 1, [ File monitoring with Inotify - sys/inotify.h ])
_ecore_have_inotify="yes"
],
[
AC_TRY_COMPILE(
[
#include <asm/unistd.h>
#include <linux/inotify.h>
],
[int a = __NR_inotify_init; int b = IN_MOVE_SELF;],
[
AC_DEFINE([HAVE_INOTIFY], [1], [ File monitoring with Inotify ])
_ecore_have_inotify="yes"
],
[_ecore_have_inotify="no"])
_ecore_have_inotify="no"
])
fi
AC_MSG_CHECKING(whether inotify is to be used for filemonitoring)
AC_MSG_RESULT($_ecore_have_inotify)
if test "x$_ecore_have_inotify" = "xyes" ; then
m4_default([$2], [:])
else

View File

@ -22,18 +22,7 @@
#ifdef HAVE_INOTIFY
#ifdef HAVE_SYS_INOTIFY
# include <sys/inotify.h>
#else
# include <asm/unistd.h>
# include <linux/inotify.h>
#endif
#ifndef HAVE_SYS_INOTIFY
static inline int inotify_init(void);
static inline int inotify_add_watch(int fd, const char *name, __u32 mask);
static inline int inotify_rm_watch(int fd, __u32 wd);
#endif
#include <sys/inotify.h>
typedef struct _Ecore_File_Monitor_Inotify Ecore_File_Monitor_Inotify;
@ -300,26 +289,6 @@ _ecore_file_monitor_inotify_monitor(Ecore_File_Monitor *em, const char *path)
return 1;
}
#ifndef HAVE_SYS_INOTIFY
static inline int
inotify_init(void)
{
return syscall(__NR_inotify_init);
}
static inline int
inotify_add_watch(int fd, const char *name, __u32 mask)
{
return syscall(__NR_inotify_add_watch, fd, name, mask);
}
static inline int
inotify_rm_watch(int fd, __u32 wd)
{
return syscall(__NR_inotify_rm_watch, fd, wd);
}
#endif
#if 0
static void
_ecore_file_monitor_inotify_print(char *file, int mask)