forked from enlightenment/efl
eio: handle failure due to lack of access right.
This commit is contained in:
parent
adff89dfc0
commit
57226d86ff
|
@ -374,6 +374,14 @@ eio_monitor_stringshared_add(const char *path)
|
|||
else
|
||||
eio_monitor_backend_add(monitor);
|
||||
|
||||
if (!monitor->backend)
|
||||
{
|
||||
WRN("Impossible to create a monitor for '%s'.", monitor->path);
|
||||
eina_stringshare_del(monitor->path);
|
||||
free(monitor);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
eina_hash_direct_add(_eio_monitors, path, monitor);
|
||||
INF("New monitor on '%s'.", path);
|
||||
|
||||
|
|
|
@ -248,9 +248,11 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
|
|||
|
||||
backend->parent = monitor;
|
||||
backend->hwnd = inotify_add_watch(ecore_main_fd_handler_fd_get(_inotify_fdh), monitor->path, mask);
|
||||
if (!backend->hwnd)
|
||||
if (backend->hwnd < 0)
|
||||
{
|
||||
eio_monitor_fallback_add(monitor);
|
||||
if (errno != EACCES)
|
||||
eio_monitor_fallback_add(monitor);
|
||||
|
||||
free(backend);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue