anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0318-core-unit-fix-unit_add_target_dependencies-for-units.patch

84b277
From 22eebbf0b5ab380173b3d8bab558719b1f408a2e Mon Sep 17 00:00:00 2001
84b277
From: Daniel Mack <zonque@gmail.com>
84b277
Date: Thu, 20 Feb 2014 13:29:54 +0100
84b277
Subject: [PATCH] core/unit: fix unit_add_target_dependencies() for units with
84b277
 no dependencies
84b277
84b277
For units without any dependencies, r needs to be initialized to 0.
84b277
Otherwise, the return value of unit_add_target_dependencies() is
84b277
unspecified.
84b277
84b277
Conflicts:
84b277
	src/core/unit.c
84b277
84b277
(cherry-picked from db57f3c6d11864f4227bb6734a0d509695a32a7d)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/core/unit.c | 2 +-
84b277
 1 file changed, 1 insertion(+), 1 deletion(-)
84b277
84b277
diff --git a/src/core/unit.c b/src/core/unit.c
84b277
index e56971b..b51e351 100644
84b277
--- a/src/core/unit.c
84b277
+++ b/src/core/unit.c
84b277
@@ -923,8 +923,8 @@ static int unit_add_default_dependencies(Unit *u) {
84b277
 
84b277
         Unit *target;
84b277
         Iterator i;
84b277
-        int r;
84b277
         unsigned k;
84b277
+        int r = 0;
84b277
 
84b277
         assert(u);
84b277