richardphibel / rpms / systemd

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