richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
984f77
From 3392b2fb9e4920e9238a09c774252dc0d0183903 Mon Sep 17 00:00:00 2001
984f77
From: Daan De Meyer <daan.j.demeyer@gmail.com>
984f77
Date: Sat, 30 Oct 2021 22:12:06 +0100
984f77
Subject: [PATCH] core: Move 'r' variable declaration to start of unit_start()
984f77
984f77
(cherry picked from commit 5f37c1a955e399756c4137d22f7f0f45a619f425)
984f77
984f77
Related: #2065322
984f77
---
984f77
 src/core/unit.c | 3 ++-
984f77
 1 file changed, 2 insertions(+), 1 deletion(-)
984f77
984f77
diff --git a/src/core/unit.c b/src/core/unit.c
984f77
index e3e534ea2e..4fd9af87b7 100644
984f77
--- a/src/core/unit.c
984f77
+++ b/src/core/unit.c
984f77
@@ -1725,12 +1725,13 @@ static bool unit_verify_deps(Unit *u) {
984f77
 int unit_start(Unit *u) {
984f77
         UnitActiveState state;
984f77
         Unit *following;
984f77
+        int r;
984f77
 
984f77
         assert(u);
984f77
 
984f77
         /* Check our ability to start early so that failure conditions don't cause us to enter a busy loop. */
984f77
         if (UNIT_VTABLE(u)->can_start) {
984f77
-                int r = UNIT_VTABLE(u)->can_start(u);
984f77
+                r = UNIT_VTABLE(u)->can_start(u);
984f77
                 if (r < 0)
984f77
                         return r;
984f77
         }