core: nicer message when inotify watches are exhausted

inotify_add_watch returns ENOSPC, which translates to
"No space left on device", which is misleading.

https://bugs.freedesktop.org/show_bug.cgi?id=73628
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-07-16 22:53:07 -04:00
parent 8c275eef38
commit 18abe7bd3e
+2 -1
View File
@@ -99,7 +99,8 @@ int path_spec_watch(PathSpec *s, sd_event_io_handler_t handler) {
break;
}
log_warning("Failed to add watch on %s: %m", s->path);
log_warning("Failed to add watch on %s: %s", s->path,
errno == ENOSPC ? "too many watches" : strerror(-r));
r = -errno;
if (cut)
*cut = tmp;