summaryrefslogtreecommitdiffstats
path: root/src/path
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
parentmakefs: define main through macro (diff)
downloadsystemd-24d5223fc99b9fee998753854ddf32b16889df26.tar.xz
systemd-24d5223fc99b9fee998753854ddf32b16889df26.zip
path: define main through macro
Diffstat (limited to 'src/path')
-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);