fix ecore-file inotify monitoring on soon-to-be deleted files

SVN revision: 71985
This commit is contained in:
Mike Blumenkrantz 2012-06-12 07:40:37 +00:00
parent b726de235a
commit 8ece74f1fd
2 changed files with 6 additions and 2 deletions

View File

@ -744,3 +744,7 @@
* ibus-immodule: Add immodule for supporting ibus.
2012-06-12 Mike Blumenkrantz
* Fixed bug in ecore-file monitoring with inotify where watching a file
that was deleted broke the world.

View File

@ -274,7 +274,7 @@ _ecore_file_monitor_inotify_events(Ecore_File_Monitor *em, char *file, int mask)
* else delete it */
if (ecore_file_exists(em->path))
{
if (!_ecore_file_monitor_inotify_monitor(em, em->path))
if (_ecore_file_monitor_inotify_monitor(em, em->path))
em->func(em->data, em, ECORE_FILE_EVENT_DELETED_SELF, em->path);
}
else
@ -301,7 +301,7 @@ _ecore_file_monitor_inotify_monitor(Ecore_File_Monitor *em, const char *path)
inotify_add_watch(ecore_main_fd_handler_fd_get(_fdh), path, mask);
if (ECORE_FILE_MONITOR_INOTIFY(em)->wd < 0)
{
ERR("inotify_add_watch error");
INF("inotify_add_watch failed, file was deleted");
ecore_file_monitor_inotify_del(em);
return 0;
}