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