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