ff2b41
From 443a7bc554b65f9b859db60474439c03b19c79c1 Mon Sep 17 00:00:00 2001
ff2b41
From: Frantisek Sumsal <fsumsal@redhat.com>
ff2b41
Date: Wed, 27 Feb 2019 18:35:15 +0100
ff2b41
Subject: [PATCH] core: drop unnecessary condition
ff2b41
ff2b41
In this case ret is always >= 0 as it still contains the initialization
ff2b41
value (i.e. 0). Let's drop the unnecessary condition to make LGTM happy.
ff2b41
ff2b41
Relevant commit: efdb02375beb0a940c3320865572913780b4d7de
ff2b41
ff2b41
Resolves: #1694605
ff2b41
---
ff2b41
 src/core/unit.c | 2 +-
ff2b41
 1 file changed, 1 insertion(+), 1 deletion(-)
ff2b41
ff2b41
diff --git a/src/core/unit.c b/src/core/unit.c
ff2b41
index cdac192eb6..4069a6f4c4 100644
ff2b41
--- a/src/core/unit.c
ff2b41
+++ b/src/core/unit.c
ff2b41
@@ -2054,7 +2054,7 @@ static int unit_watch_pids_in_path(Unit *u, const char *path) {
ff2b41
                 if (r < 0 && ret >= 0)
ff2b41
                         ret = r;
ff2b41
 
ff2b41
-        } else if (ret >= 0)
ff2b41
+        } else
ff2b41
                 ret = r;
ff2b41
 
ff2b41
         r = cg_enumerate_subgroups(SYSTEMD_CGROUP_CONTROLLER, path, &d);