]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: log about all errors in path_spec_watch()
authorLennart Poettering <lennart@poettering.net>
Tue, 25 May 2021 21:08:50 +0000 (23:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 25 May 2021 21:14:30 +0000 (23:14 +0200)
So far we logged about most, but not all errors. Adding log to all
errors.

src/core/path.c

index 0512287baf7f1ff5c13494d509760a2faac32a83..355f6c645d49d075fa54fee7f49bc2d469e05136 100644 (file)
@@ -55,13 +55,15 @@ int path_spec_watch(PathSpec *s, sd_event_io_handler_t handler) {
 
         s->inotify_fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC);
         if (s->inotify_fd < 0) {
-                r = -errno;
+                r = log_error_errno(errno, "Failed to allocate inotify fd: %m");
                 goto fail;
         }
 
         r = sd_event_add_io(s->unit->manager->event, &s->event_source, s->inotify_fd, EPOLLIN, handler, s);
-        if (r < 0)
+        if (r < 0) {
+                log_error_errno(r, "Failed to add inotify fd to event loop: %m");
                 goto fail;
+        }
 
         (void) sd_event_source_set_description(s->event_source, "path");