From 52b353ebae5deaf3d07e2cd83d2a790a5f531409 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 25 Jul 2025 19:37:49 +0200 Subject: [PATCH] os: log: suppress warnings on ignore retval of write() These callers really don't wanna care about the return values, so we can safely suppress the warnings. Signed-off-by: Enrico Weigelt, metux IT consult --- os/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/log.c b/os/log.c index 82fc92e2e..011ff044e 100644 --- a/os/log.c +++ b/os/log.c @@ -268,7 +268,7 @@ LogInit(const char *fname, const char *backup) /* Flush saved log information. */ if (saveBuffer && bufferSize > 0) { - write(logFileFd, saveBuffer, bufferPos); + (void)write(logFileFd, saveBuffer, bufferPos); doLogSync(); } } @@ -602,7 +602,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) localtime_r(&t, &tm); strftime(fmt_tm, sizeof(fmt_tm) - 1, "[%Y-%m-%d %H:%M:%S] ", &tm); - write(logFileFd, fmt_tm, strlen(fmt_tm)); + (void)write(logFileFd, fmt_tm, strlen(fmt_tm)); } newline = end_line; write(logFileFd, buf, len);