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