From: skeezix Date: Thu, 19 Feb 2009 21:30:05 +0000 (-0500) Subject: Fixed bug in pnd_notify that prevented 'mv' files in/out from working. Now X-Git-Tag: Release-2010-05/1~218 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e122057d025f6a01822830663fc53ae6fbfb08e6;p=pandora-libraries.git Fixed bug in pnd_notify that prevented 'mv' files in/out from working. Now moving an app into watches will create/remove .desktop correctly --- diff --git a/lib/pnd_notify.c b/lib/pnd_notify.c index 3c4ce46..b6668d6 100644 --- a/lib/pnd_notify.c +++ b/lib/pnd_notify.c @@ -19,6 +19,10 @@ static int notify_handle; static void pnd_notify_hookup ( int fd ); +#define PND_INOTIFY_MASK IN_CREATE | IN_DELETE | IN_UNMOUNT \ + | IN_DELETE_SELF | IN_MOVE_SELF \ + | IN_MOVED_FROM | IN_MOVED_TO + pnd_notify_handle pnd_notify_init ( void ) { int fd; pnd_notify_t *p; @@ -63,7 +67,7 @@ static int pnd_notify_callback ( const char *fpath, const struct stat *sb, //printf ( "Implicitly watching dir '%s'\n", fpath ); - inotify_add_watch ( notify_handle, fpath, IN_CREATE | IN_DELETE | IN_UNMOUNT ); + inotify_add_watch ( notify_handle, fpath, PND_INOTIFY_MASK ); return ( 0 ); // continue the tree walk } @@ -72,11 +76,7 @@ void pnd_notify_watch_path ( pnd_notify_handle h, char *fullpath, unsigned int f pnd_notify_t *p = (pnd_notify_t*) h; #if 1 - inotify_add_watch ( p -> fd, fullpath, - IN_CREATE | IN_DELETE | IN_UNMOUNT - | IN_DELETE_SELF | IN_MOVE_SELF - | IN_MOVED_FROM | IN_MOVED_TO - ); + inotify_add_watch ( p -> fd, fullpath, PND_INOTIFY_MASK ); #else inotify_add_watch ( p -> fd, fullpath, IN_ALL_EVENTS ); #endif