From 24d5223fc99b9fee998753854ddf32b16889df26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 16 Nov 2018 14:54:20 +0100 Subject: [PATCH] path: define main through macro --- src/path/path.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/path/path.c b/src/path/path.c index 918638ff808..1b7e0c547a5 100644 --- a/src/path/path.c +++ b/src/path/path.c @@ -167,7 +167,7 @@ static int parse_argv(int argc, char *argv[]) { return 1; } -int main(int argc, char* argv[]) { +static int run(int argc, char* argv[]) { int r; log_parse_environment(); @@ -175,7 +175,7 @@ int main(int argc, char* argv[]) { r = parse_argv(argc, argv); if (r <= 0) - goto finish; + return r; if (argc > optind) { int i, q; @@ -185,9 +185,10 @@ int main(int argc, char* argv[]) { if (q < 0) r = q; } - } else - r = list_homes(); -finish: - return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; + return r; + } else + return list_homes(); } + +DEFINE_MAIN_FUNCTION(run);