Report write errors from writesf(), writellf(), and writedf()

The write functions return success when nothing was written, e.g., on
a stream that is not open for writing:

    writesf("data", "r", "/tmp/file");

They return the result of fclose() and drop the one from fprintf().

Return -1 when fprintf() fails, with errno from the failed write.

Closes #25
This commit is contained in:
omrzk authored and Joachim Wiberg committed 2026-11-16 14:13:07 +01:00
1 parent 8befd09cf5
commit 0013f4fcf4
4 files changed
+80 -6

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ TESTS += lfile
TESTS += makepath
TESTS += pidfile
TESTS += printhdr
TESTS += procval
TESTS += progress
TESTS += rsync
TESTS += runbg