Skip to content

Commit

Permalink
log invalid env setting more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
john30 committed Sep 23, 2023
1 parent b0cfb52 commit 70db4fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ebusd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,10 @@ int main(int argc, char* argv[], char* envp[]) {
error_t err = argp_parse(&aargp, cnt, envargv, ARGP_PARSE_ARGV0|ARGP_SILENT|ARGP_IN_ORDER, &idx, &s_opt);
if (err != 0 && idx == -1) { // ignore args for non-arg boolean options
if (err == ESRCH) { // special value to abort immediately
logWrite(lf_main, ll_error, "invalid argument in env: %s", envopt); // force logging on exit
logWrite(lf_main, ll_error, "invalid argument in env: %s", *env); // force logging on exit
return EINVAL;
}
logWrite(lf_main, ll_error, "invalid/unknown argument in env (ignored): %s", envopt); // force logging
logWrite(lf_main, ll_error, "invalid/unknown argument in env (ignored): %s", *env); // force logging
}
s_opt.injectMessages = false; // restore (was not parsed from cmdline args yet)
}
Expand Down

0 comments on commit 70db4fa

Please sign in to comment.