1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

run: port to DEFINE_MAIN_FUNCTION()

This commit is contained in:
Lennart Poettering 2018-11-22 19:30:03 +01:00
parent badd28e158
commit ef08ad7aa8

View File

@ -14,6 +14,7 @@
#include "env-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "main-func.h"
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
@ -1539,7 +1540,7 @@ static int start_transient_trigger(
return 0;
}
int main(int argc, char* argv[]) {
static int run(int argc, char* argv[]) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_free_ char *description = NULL;
int r, retval = EXIT_SUCCESS;
@ -1612,5 +1613,7 @@ finish:
strv_free(arg_cmdline);
free(arg_working_directory);
return r < 0 ? EXIT_FAILURE : retval;
return r < 0 ? r : retval;
}
DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE(run);