diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-16 12:25:43 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-17 09:13:35 +0100 |
commit | 5272ae42ce4b970e710882660ef54ba06335ca51 (patch) | |
tree | 8da5fa2e538136576f461f7a33a42f3cd01b0758 /src/import/export.c | |
parent | id128: define main through macro (diff) | |
download | systemd-5272ae42ce4b970e710882660ef54ba06335ca51.tar.xz systemd-5272ae42ce4b970e710882660ef54ba06335ca51.zip |
import: define mains through macro
Diffstat (limited to 'src/import/export.c')
-rw-r--r-- | src/import/export.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/import/export.c b/src/import/export.c index 03eb3e40b2..317ac1bba7 100644 --- a/src/import/export.c +++ b/src/import/export.c @@ -269,7 +269,6 @@ static int parse_argv(int argc, char *argv[]) { } static int export_main(int argc, char *argv[]) { - static const Verb verbs[] = { { "help", VERB_ANY, VERB_ANY, 0, help }, { "tar", 2, 3, 0, export_tar }, @@ -280,7 +279,7 @@ static int export_main(int argc, char *argv[]) { return dispatch_verb(argc, argv, verbs, NULL); } -int main(int argc, char *argv[]) { +static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); @@ -289,12 +288,11 @@ int main(int argc, char *argv[]) { r = parse_argv(argc, argv); if (r <= 0) - goto finish; + return r; (void) ignore_signals(SIGPIPE, -1); - r = export_main(argc, argv); - -finish: - return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; + return export_main(argc, argv); } + +DEFINE_MAIN_FUNCTION(run); |