diff options
Diffstat (limited to 'src/environment-d-generator')
-rw-r--r-- | src/environment-d-generator/environment-d-generator.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/environment-d-generator/environment-d-generator.c b/src/environment-d-generator/environment-d-generator.c index 12aafbc7d9..e3fea1f2b0 100644 --- a/src/environment-d-generator/environment-d-generator.c +++ b/src/environment-d-generator/environment-d-generator.c @@ -8,6 +8,7 @@ #include "escape.h" #include "glyph-util.h" #include "log.h" +#include "main-func.h" #include "path-lookup.h" #include "strv.h" @@ -80,20 +81,19 @@ static int load_and_print(void) { return 0; } -int main(int argc, char *argv[]) { +static int run(int argc, char *argv[]) { int r; log_parse_environment(); log_open(); - if (argc > 1) { - log_error("This program takes no arguments."); - return EXIT_FAILURE; - } + if (argc > 1) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program takes no arguments."); r = load_and_print(); if (r < 0) - log_error_errno(r, "Failed to load environment.d: %m"); - - return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; + return log_error_errno(r, "Failed to load environment.d: %m"); + return 0; } + +DEFINE_MAIN_FUNCTION(run); |