dcavalca / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
Blob Blame History Raw
From 7f70164f5cce9f63b5fe103c81c47b29a2fd8a99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 16 Jul 2014 22:52:53 -0400
Subject: [PATCH] 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
(cherry picked from commit 18abe7bd3e13525b257da69ac49ff7841c289567)
(cherry picked from commit fe85271fb6090e58b36e182ce3e20a388f0ca006)
---
 src/core/path.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/path.c b/src/core/path.c
index 5e4f6d5b69..538c1eaebd 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -95,7 +95,8 @@ int path_spec_watch(PathSpec *s, Unit *u) {
                                 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;