summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-06 17:32:51 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-06 17:32:51 +0100
commit84f6181c2ac99a0514ca5e0c8fc8c8e284caf789 (patch)
tree2496dfa8c63334faa132853647eb8acca415e752 /src/locale
parent66b1e746055b9c56fd72c0451a4cfb2b06cf3f20 (diff)
clients: various simplifications
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/localectl.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index e3d98c4bd0..c70470fe00 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -794,33 +794,27 @@ static int localectl_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 = localectl_main(bus, argc, argv);
- ret = r < 0 ? EXIT_FAILURE : r;
finish:
pager_close();
- return ret;
+ return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}