803fb7
From c086e8c91b0dc455bfa5fa09f3f5aa20c582b2a0 Mon Sep 17 00:00:00 2001
803fb7
From: Michal Sekletar <msekleta@redhat.com>
803fb7
Date: Thu, 25 Jun 2015 16:06:40 +0200
803fb7
Subject: [PATCH] install: explicitly return 0 on success
803fb7
803fb7
Maybe there is some left-over value stored in r from previous function
803fb7
call. Let's make sure we always return consistent error code when we reach end of
803fb7
the function body.
803fb7
803fb7
Fixes following crash of test-install,
803fb7
803fb7
Assertion 'r == 0' failed at src/test/test-install.c:52, function main(). Aborting.
803fb7
[1]    11703 abort (core dumped)  ./test-install
803fb7
803fb7
(cherry picked from commit 77cd2c87a47c49aa9063fbaa4d9077f4a381cab1)
803fb7
803fb7
Cherry-picked from: 77cd2c8
803fb7
Resolves: #1222517
803fb7
---
803fb7
 src/shared/install.c | 2 +-
803fb7
 1 file changed, 1 insertion(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/shared/install.c b/src/shared/install.c
803fb7
index b62065be5..aa197e91b 100644
803fb7
--- a/src/shared/install.c
803fb7
+++ b/src/shared/install.c
803fb7
@@ -2265,7 +2265,7 @@ int unit_file_get_list(
803fb7
                 }
803fb7
         }
803fb7
 
803fb7
-        return r;
803fb7
+        return 0;
803fb7
 }
803fb7
 
803fb7
 static const char* const unit_file_state_table[_UNIT_FILE_STATE_MAX] = {