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