This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=919c568044fc2497e8146039f07822ff1c9d89ae commit 919c568044fc2497e8146039f07822ff1c9d89ae (HEAD -> master) Author: Guillem Jover <[email protected]> AuthorDate: Sun Jun 28 17:20:26 2020 +0200 libdpkg: Print a notice if we cannot write to the log file If we cannot write to the log file we should at least let the user know, but in the same way we do not error out if we cannot open the log file, we will not error out here. Warned-by: coverity --- debian/changelog | 2 ++ lib/dpkg/log.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 471d5f424..9db1f3939 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ dpkg (1.20.3) UNRELEASED; urgency=medium import_key(), to make sure we do not write to the user home directory, which might be read-only or non-existent. Reported by Mattia Rizzolo <[email protected]>. + * Code internals: + - libdpkg: Print a notice if we cannot write to the log file. [ Updated programs translations ] * German (Sven Joachim). diff --git a/lib/dpkg/log.c b/lib/dpkg/log.c index df33579a7..d1be05e25 100644 --- a/lib/dpkg/log.c +++ b/lib/dpkg/log.c @@ -73,7 +73,9 @@ log_message(const char *fmt, ...) varbuf_end_str(&log); va_end(args); - fd_write(logfd, log.buf, log.used); + if (fd_write(logfd, log.buf, log.used) < 0) + notice(_("cannot write to log file '%s': %s"), + log_file, strerror(errno)); } struct pipef { -- Dpkg.Org's dpkg

