From: Martin Pitt Date: Fri, 28 Nov 2014 14:38:05 +0000 (+0100) Subject: hostnamectl: Exit with zero on success X-Git-Tag: v218~251 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5567fafbc9d83a1391f23ecdbe698a3c03929370;hp=755bde375f4db393ad06e73340bfcf4d0cf91bb2;p=elogind.git 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 1026e195d..b3ce8510b 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; }