richardphibel / rpms / systemd

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