summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2016-07-15 17:04:21 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-07-15 17:07:49 -0700
commit57226d86ff02777b6f68c5b00391015262f65c53 (patch)
tree51ef8414ec7d0531ee4e8cb18a4e2f88a7ef6252 /src/lib/eio
parentadff89dfc0fc486c42382941328ec315e4aa4ff1 (diff)
eio: handle failure due to lack of access right.
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_monitor.c8
-rw-r--r--src/lib/eio/eio_monitor_inotify.c6
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c
index d30dfd28a4..5c4eb8fbb1 100644
--- a/src/lib/eio/eio_monitor.c
+++ b/src/lib/eio/eio_monitor.c
@@ -374,6 +374,14 @@ eio_monitor_stringshared_add(const char *path)
374 else 374 else
375 eio_monitor_backend_add(monitor); 375 eio_monitor_backend_add(monitor);
376 376
377 if (!monitor->backend)
378 {
379 WRN("Impossible to create a monitor for '%s'.", monitor->path);
380 eina_stringshare_del(monitor->path);
381 free(monitor);
382 return NULL;
383 }
384
377 eina_hash_direct_add(_eio_monitors, path, monitor); 385 eina_hash_direct_add(_eio_monitors, path, monitor);
378 INF("New monitor on '%s'.", path); 386 INF("New monitor on '%s'.", path);
379 387
diff --git a/src/lib/eio/eio_monitor_inotify.c b/src/lib/eio/eio_monitor_inotify.c
index 2222a56476..92795165c1 100644
--- a/src/lib/eio/eio_monitor_inotify.c
+++ b/src/lib/eio/eio_monitor_inotify.c
@@ -248,9 +248,11 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
248 248
249 backend->parent = monitor; 249 backend->parent = monitor;
250 backend->hwnd = inotify_add_watch(ecore_main_fd_handler_fd_get(_inotify_fdh), monitor->path, mask); 250 backend->hwnd = inotify_add_watch(ecore_main_fd_handler_fd_get(_inotify_fdh), monitor->path, mask);
251 if (!backend->hwnd) 251 if (backend->hwnd < 0)
252 { 252 {
253 eio_monitor_fallback_add(monitor); 253 if (errno != EACCES)
254 eio_monitor_fallback_add(monitor);
255
254 free(backend); 256 free(backend);
255 return; 257 return;
256 } 258 }