chiark / gitweb /
install: explicitly return 0 on success
authorMichal Sekletar <msekleta@redhat.com>
Thu, 25 Jun 2015 14:06:40 +0000 (16:06 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:05:35 +0000 (10:05 +0100)
Maybe there is some left-over value stored in r from previous function
call. Let's make sure we always return consistent error code when we reach end of
the function body.

Fixes following crash of test-install,

Assertion 'r == 0' failed at src/test/test-install.c:52, function main(). Aborting.
[1]    11703 abort (core dumped)  ./test-install

src/shared/install.c

index 559fda211dbd95b581d0eccc171392e048f3cbc7..c37cf1948a07bf68ea3108d6024b5d5860aae464 100644 (file)
@@ -2263,7 +2263,7 @@ int unit_file_get_list(
                 }
         }
 
-        return r;
+        return 0;
 }
 
 static const char* const unit_file_state_table[_UNIT_FILE_STATE_MAX] = {