diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-19 15:28:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 15:28:17 +0100 |
commit | 2a44bf5099d4b13d90d4a6c93b404894960487ee (patch) | |
tree | 984ba8892e42155bfa981099270e5c7e2f49f51b /src/path | |
parent | 2675747f3cdd6f1e6236bbb2f79abfa53fb307f1 (diff) | |
parent | 51e237864221f3edb0c0fb28684901f538341cb1 (diff) | |
download | systemd-2a44bf5099d4b13d90d4a6c93b404894960487ee.tar.gz |
Merge pull request #10811 from keszybz/define-main-through-macro
Define main through macro
Diffstat (limited to 'src/path')
-rw-r--r-- | src/path/path.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/path/path.c b/src/path/path.c index 918638ff80..1b7e0c547a 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); |