Skip to content

Commit

Permalink
logging: fix error handling
Browse files Browse the repository at this point in the history
sd_journal_sendv returns a negative errno, so negate it before usage.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Nov 3, 2022
1 parent 9e416a2 commit 4fb5e06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ctr_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static int write_journald(int pipe, char *buf, ssize_t buflen)

int err = sd_journal_sendv(bufv.iov, bufv.iovcnt);
if (err < 0) {
pwarn(strerror(err));
pwarn(strerror(-err));
return err;
}

Expand Down

0 comments on commit 4fb5e06

Please sign in to comment.