From e1f16731efe07563f0b157a53890016ddcae2647 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Mon, 5 Nov 2012 21:59:39 +0000 Subject: [PATCH] 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 --- legacy/ecore/m4/ecore_check_options.m4 | 29 ++++------------ .../ecore_file/ecore_file_monitor_inotify.c | 33 +------------------ 2 files changed, 7 insertions(+), 55 deletions(-) diff --git a/legacy/ecore/m4/ecore_check_options.m4 b/legacy/ecore/m4/ecore_check_options.m4 index d20adcaeca..0885e58afb 100644 --- a/legacy/ecore/m4/ecore_check_options.m4 +++ b/legacy/ecore/m4/ecore_check_options.m4 @@ -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 - #include - ], - [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 diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c index 7701e1f7e2..2f75187340 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -22,18 +22,7 @@ #ifdef HAVE_INOTIFY -#ifdef HAVE_SYS_INOTIFY -# include -#else -# include -# include -#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 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)