When a 'hard' error occurs, fwrite reports that all data was written or
buffered even if that is not the case. It should report how much data
was actually written and buffered.
Signed-off-by: Jan Vangorp <jan.vangorp_ext(a)softathome.com>
---
libc/stdio/_WRITE.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libc/stdio/_WRITE.c b/libc/stdio/_WRITE.c
index 113f0eb..f95bd1b 100644
--- a/libc/stdio/_WRITE.c
+++ b/libc/stdio/_WRITE.c
@@ -76,6 +76,7 @@ size_t attribute_hidden __stdio_WRITE(register FILE *stream,
*/
if (errno != EINTR && errno != EAGAIN) {
/* do we have other "soft" errors? */
+ bufsize -= todo;
break;
}
#ifdef __STDIO_BUFFERS
--
1.9.1