Enlightenment CVS committal
Author : sebastid
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_file
Modified Files:
ecore_file_monitor_inotify.c
Log Message:
inotify is updated to support only kernel 2.6.13 with an updated
kernel-headers. It should work with some older revisions of inotify with
some hacking, but I don't have different versions to check with.
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file_monitor_inotify.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ecore_file_monitor_inotify.c 27 Aug 2005 12:25:22 -0000 1.6
+++ ecore_file_monitor_inotify.c 29 Aug 2005 15:15:59 -0000 1.7
@@ -13,48 +13,9 @@
#ifdef HAVE_INOTIFY
-#include <sys/syscall.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+#include <asm/unistd.h>
#include <linux/inotify.h>
-/* These should go when it is standard that they are defined in userspace
kernel headers */
-#if defined(__i386__)
-# define __NR_inotify_init 291
-# define __NR_inotify_add_watch 292
-# define __NR_inotify_rm_watch 293
-#elif defined(__x86_64__)
-# define __NR_inotify_init 253
-# define __NR_inotify_add_watch 254
-# define __NR_inotify_rm_watch 255
-#elif defined(__alpha__)
-# define __NR_inotify_init 444
-# define __NR_inotify_add_watch 445
-# define __NR_inotify_rm_watch 446
-#elif defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__)
-# define __NR_inotify_init 275
-# define __NR_inotify_add_watch 276
-# define __NR_inotify_rm_watch 277
-#elif defined(__sparc__)
-# define __NR_inotify_init 151
-# define __NR_inotify_add_watch 152
-# define __NR_inotify_rm_watch 156
-#elif defined (__ia64__)
-# define __NR_inotify_init 1277
-# define __NR_inotify_add_watch 1278
-# define __NR_inotify_rm_watch 1279
-#elif defined (__s390__)
-# define __NR_inotify_init 284
-# define __NR_inotify_add_watch 285
-# define __NR_inotify_rm_watch 286
-#else
-# warning "Unsupported architecture"
-#endif
-
-#ifdef __NR_inotify_init
-
typedef struct _Ecore_File_Monitor_Inotify Ecore_File_Monitor_Inotify;
#define ECORE_FILE_MONITOR_INOTIFY(x) ((Ecore_File_Monitor_Inotify *)(x))
@@ -131,7 +92,6 @@
Ecore_File_Monitor *em;
int len;
- printf("Using inotify!\n");
em = calloc(1, sizeof(Ecore_File_Monitor_Inotify));
if (!em) return NULL;
@@ -155,7 +115,7 @@
mask);
if (ECORE_FILE_MONITOR_INOTIFY(em)->wd < 0)
{
- printf("ioctl error\n");
+ printf("inotify_add_watch error\n");
ecore_file_monitor_inotify_del(em);
return NULL;
}
@@ -277,6 +237,11 @@
{
em->func(em->data, em, ECORE_FILE_EVENT_DELETED_SELF, em->path);
}
+ if (mask & IN_MOVE_SELF)
+ {
+ /* We just call delete. The dir is gone... */
+ em->func(em->data, em, ECORE_FILE_EVENT_DELETED_SELF, em->path);
+ }
if (mask & IN_UNMOUNT)
{
/* We just call delete. The dir is gone... */
@@ -301,5 +266,4 @@
{
return syscall(__NR_inotify_rm_watch, fd, wd);
}
-#endif /* __NR_inotify_init */
#endif /* HAVE_INOTIFY */
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs