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