chiark / gitweb /
core: nicer message when inotify watches are exhausted
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Jul 2014 02:52:53 +0000 (22:52 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Jul 2014 02:53:07 +0000 (22:53 -0400)
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

src/core/path.c

index 20e454d96f4c1ba04a463c7ac92d920303e12948..f54c77f6c3980804ececcf23a1286221adf37a7c 100644 (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;