[systemd-commits] src/hostname

David Herrmann dvdhrm at kemper.freedesktop.org
Fri Nov 28 08:16:12 PST 2014


 src/hostname/hostnamectl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5567fafbc9d83a1391f23ecdbe698a3c03929370
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Fri Nov 28 15:38:05 2014 +0100

    hostnamectl: Exit with zero on success
    
    In show_all_names(), bus_map_all_properties() returns 1 on success which is
    then used as the return code of show_all_names() and eventually main(). Exit
    with zero in main() on all nonnegative results to guard against similar errors.

diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index 1026e19..b3ce851 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -536,5 +536,5 @@ int main(int argc, char *argv[]) {
         r = hostnamectl_main(bus, argc, argv);
 
 finish:
-        return r < 0 ? EXIT_FAILURE : r;
+        return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }



More information about the systemd-commits mailing list