diff options
Diffstat (limited to 'src/timedate')
-rw-r--r-- | src/timedate/timedatectl.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 461540e89b..9926a8a880 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -581,33 +581,27 @@ static int timedatectl_main(sd_bus *bus, int argc, char *argv[]) { } int main(int argc, char *argv[]) { - int r, ret = EXIT_FAILURE; _cleanup_bus_unref_ sd_bus *bus = NULL; + int r; setlocale(LC_ALL, ""); log_parse_environment(); log_open(); r = parse_argv(argc, argv); - if (r < 0) + if (r <= 0) goto finish; - else if (r == 0) { - ret = EXIT_SUCCESS; - goto finish; - } r = bus_open_transport(arg_transport, arg_host, false, &bus); if (r < 0) { log_error("Failed to create bus connection: %s", strerror(-r)); - ret = EXIT_FAILURE; goto finish; } r = timedatectl_main(bus, argc, argv); - ret = r < 0 ? EXIT_FAILURE : r; finish: pager_close(); - return ret; + return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; } |