Skip to content

Commit

Permalink
error: do not write error twice to stderr
Browse files Browse the repository at this point in the history
it solves the following error:

$ crun --log-level foo run foo
2024-09-05T21:13:00.024172Z: unknown verbosity `foo` specified
2024-09-05T21:13:00.024273Z: unknown verbosity `foo` specified

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Sep 5, 2024
1 parent 5e35dfe commit 3dbf152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcrun/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ write_log (int errno_, int verbosity, const char *msg, va_list args_list)
if (UNLIKELY (ret < 0))
OOM ();

if (verbosity == LIBCRUN_VERBOSITY_ERROR)
if (verbosity == LIBCRUN_VERBOSITY_ERROR && output_handler != log_write_to_stderr)
log_write_to_stderr (errno_, output, LIBCRUN_VERBOSITY_ERROR, NULL);

switch (log_format)
Expand Down

0 comments on commit 3dbf152

Please sign in to comment.