- if the file doesn't exist or the monitor add fails then we will delete the
item from the list, but if the item isn't in the list the resultant list ends up being NULL and we lose everything being monitored so far. So, add the item to the list earlier so we can remove it safely if needed. SVN revision: 30584
This commit is contained in:
parent
0aba1dbca4
commit
84c6b57869
|
@ -114,6 +114,8 @@ ecore_file_monitor_inotify_add(const char *path,
|
|||
if (em->path[len - 1] == '/' && strcmp(em->path, "/"))
|
||||
em->path[len - 1] = 0;
|
||||
|
||||
_monitors = _ecore_list2_append(_monitors, em);
|
||||
|
||||
if (ecore_file_exists(em->path))
|
||||
{
|
||||
if (!_ecore_file_monitor_inotify_monitor(em, em->path))
|
||||
|
@ -129,8 +131,6 @@ ecore_file_monitor_inotify_add(const char *path,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
_monitors = _ecore_list2_append(_monitors, em);
|
||||
|
||||
return em;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue