summaryrefslogtreecommitdiff
path: root/src/path/path.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-16 14:54:20 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-17 09:13:35 +0100
commit24d5223fc99b9fee998753854ddf32b16889df26 (patch)
tree7f52212e785ae215431f212eb7f22d70d0ddb851 /src/path/path.c
parentfb1fa5a88283a108988b9357f2f312f8cee806aa (diff)
downloadsystemd-24d5223fc99b9fee998753854ddf32b16889df26.tar.gz
path: define main through macro
Diffstat (limited to 'src/path/path.c')
-rw-r--r--src/path/path.c13
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);