richardphibel / rpms / systemd

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