generators: configure logging before the first use

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-12-12 10:48:38 +01:00
parent f7e81fd96f
commit aba311f7ff
7 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -145,6 +145,8 @@ static int generate_wants_symlinks(void) {
static int run(int argc, char *argv[]) {
int r, q;
log_setup_generator();
if (argc > 1 && argc != 4)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"This program takes three or no arguments.");
@@ -152,8 +154,6 @@ static int run(int argc, char *argv[]) {
if (argc > 1)
arg_dest = argv[2];
log_setup_generator();
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_RD_STRICT | PROC_CMDLINE_STRIP_RD_PREFIX);
if (r < 0)
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");