mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
The old function used int for write() return values, that could overflow. And the return values of the write calls were discarded and not checked. Now if the write() to the log file fails, a warning will be logged to stderr and the log message will be appended after the warning. If writes to stderr fail, a warning will be logged to stdout and the log message will be appended after the warning. If writes to stdout fail, we can't really do anything else and will continue on silently. Also used the length returned by strftime for the next write call to eliminate an extra use of strlen. The -1 was also removed from the buflen argument of strftime because it was unnecessary. Did some small formatting changes too. Signed-off-by: b-aaz <b-aazbsd@proton.me>
28 KiB
28 KiB