summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-16 12:13:28 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-17 09:13:35 +0100
commit06213aae94eeb59a7e343d2071c5e3c8def2f732 (patch)
tree21a34efec376292c085d8ed9ece32feb0a337ce2
parent43ead4114bcd2ad1537d5990c28416aca3951461 (diff)
downloadsystemd-06213aae94eeb59a7e343d2071c5e3c8def2f732.tar.gz
hwdb: define main through macro
-rw-r--r--src/hwdb/hwdb.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
index be64a26d64..87b84b70a9 100644
--- a/src/hwdb/hwdb.c
+++ b/src/hwdb/hwdb.c
@@ -110,7 +110,7 @@ static int hwdb_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;
log_parse_environment();
@@ -118,12 +118,11 @@ int main (int argc, char *argv[]) {
r = parse_argv(argc, argv);
if (r <= 0)
- goto finish;
+ return r;
mac_selinux_init();
- r = hwdb_main(argc, argv);
-
-finish:
- return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+ return hwdb_main(argc, argv);
}
+
+DEFINE_MAIN_FUNCTION(run);