X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fpath.c;h=f54c77f6c3980804ececcf23a1286221adf37a7c;hb=f1f00dbb7f3741b30d4a26b1a8b65ec46ff1fde3;hp=93c51bb3bec5b0363003c7624e077f252bfd9b4a;hpb=2c5859afecee81e345fc9526b1083bf79990ffb8;p=elogind.git diff --git a/src/core/path.c b/src/core/path.c index 93c51bb3b..f54c77f6c 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -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; @@ -152,11 +153,7 @@ void path_spec_unwatch(PathSpec *s) { assert(s); s->event_source = sd_event_source_unref(s->event_source); - - if (s->inotify_fd >= 0) { - close_nointr_nofail(s->inotify_fd); - s->inotify_fd = -1; - } + s->inotify_fd = safe_close(s->inotify_fd); } int path_spec_fd_event(PathSpec *s, uint32_t revents) {