naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
b7dd4d
From 3392b2fb9e4920e9238a09c774252dc0d0183903 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
b7dd4d
Related: #2065322
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
         }