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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-07-25 19:37:49 +02:00
parent 6aaa2d3a36
commit 52b353ebae

View File

@@ -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);