teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0776-analyze-actually-select-longest-activated-time-of-se.patch

ff2b41
From 91b866591a2fb05a087a040a49a792a3d40a2a06 Mon Sep 17 00:00:00 2001
ff2b41
From: Yu Watanabe <watanabe.yu+github@gmail.com>
ff2b41
Date: Wed, 27 Jun 2018 13:32:05 +0900
ff2b41
Subject: [PATCH] analyze: actually select longest activated-time of services
ff2b41
ff2b41
Discovered by LGTM.
ff2b41
ff2b41
(cherry picked from commit e68131526b7a2cfdb8e59bd2ed7a284dba095ac5)
ff2b41
ff2b41
Resolves: #1694605
ff2b41
---
ff2b41
 src/analyze/analyze.c | 7 ++-----
ff2b41
 1 file changed, 2 insertions(+), 5 deletions(-)
ff2b41
ff2b41
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
ff2b41
index 7116aaa88d..e9ca9ba818 100644
ff2b41
--- a/src/analyze/analyze.c
ff2b41
+++ b/src/analyze/analyze.c
ff2b41
@@ -788,14 +788,11 @@ static int list_dependencies_one(sd_bus *bus, const char *name, unsigned int lev
ff2b41
                 if (times
ff2b41
                     && times->activated
ff2b41
                     && times->activated <= boot->finish_time
ff2b41
-                    && (times->activated >= service_longest
ff2b41
-                        || service_longest == 0)) {
ff2b41
+                    && times->activated >= service_longest)
ff2b41
                         service_longest = times->activated;
ff2b41
-                        break;
ff2b41
-                }
ff2b41
         }
ff2b41
 
ff2b41
-        if (service_longest == 0 )
ff2b41
+        if (service_longest == 0)
ff2b41
                 return r;
ff2b41
 
ff2b41
         STRV_FOREACH(c, deps) {