teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0800-path-stop-watching-path-specs-once-we-triggered-the-.patch

ff2b41
From 6a0d21a508e43ca7a89b700e98fd86a08eff4fee Mon Sep 17 00:00:00 2001
ff2b41
From: Michal Sekletar <msekleta@redhat.com>
ff2b41
Date: Mon, 9 Sep 2019 14:38:35 +0200
ff2b41
Subject: [PATCH] path: stop watching path specs once we triggered the target
ff2b41
 unit
ff2b41
ff2b41
We start watching them again once we get a notification that triggered
ff2b41
unit entered inactive or failed state.
ff2b41
ff2b41
Fixes: #10503
ff2b41
(cherry picked from commit 8fca6944c2ee20c63d62154c8badddc77170b176)
ff2b41
ff2b41
Resolves: #1641777
ff2b41
---
ff2b41
 src/core/path.c | 6 ++----
ff2b41
 1 file changed, 2 insertions(+), 4 deletions(-)
ff2b41
ff2b41
diff --git a/src/core/path.c b/src/core/path.c
ff2b41
index 0533bb4e21..a74cbf2372 100644
ff2b41
--- a/src/core/path.c
ff2b41
+++ b/src/core/path.c
ff2b41
@@ -497,11 +497,9 @@ static void path_enter_running(Path *p) {
ff2b41
 
ff2b41
         p->inotify_triggered = false;
ff2b41
 
ff2b41
-        r = path_watch(p);
ff2b41
-        if (r < 0)
ff2b41
-                goto fail;
ff2b41
-
ff2b41
         path_set_state(p, PATH_RUNNING);
ff2b41
+        path_unwatch(p);
ff2b41
+
ff2b41
         return;
ff2b41
 
ff2b41
 fail: