summaryrefslogtreecommitdiff
path: root/src/machine
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/machine
parent66b1e746055b9c56fd72c0451a4cfb2b06cf3f20 (diff)
clients: various simplifications
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 8468436646..ee802b1e8b 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -849,35 +849,29 @@ static int machinectl_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 = machinectl_main(bus, argc, argv);
- ret = r < 0 ? EXIT_FAILURE : r;
finish:
- strv_free(arg_property);
-
pager_close();
- return ret;
+ strv_free(arg_property);
+
+ return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}