teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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