Skip to content

Commit

Permalink
Merge pull request #1555 from giuseppe/fix-double-message
Browse files Browse the repository at this point in the history
error: do not write error twice to stderr
  • Loading branch information
rhatdan authored Sep 6, 2024
2 parents c1226eb + 3dbf152 commit c00c467
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libcrun/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ log_write_to_stream (int errno_, const char *msg, int verbosity, void *arg)
switch (verbosity)
{
case LIBCRUN_VERBOSITY_DEBUG:
color_begin = "\x1b[1;34m";
color_end = "\x1b[0m";
break;
case LIBCRUN_VERBOSITY_WARNING:
color_begin = "\x1b[1;33m";
Expand Down Expand Up @@ -432,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 c00c467

Please sign in to comment.