summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorJan Vangorp <jan.vangorp_ext@softathome.com>2016-06-08 22:00:49 (GMT)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-06-12 09:44:45 (GMT)
commit96f2821683ec41a28b5aa6ec92245e47dfee989b (patch)
tree807f48ec85a5f2f02ac09146e89dfd831eb90339 /libc
parent568ceebf6adfc58c64a95133311268db626cdec2 (diff)
Fix return value of fwrite when a 'hard' error occurs
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@softathome.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/stdio/_WRITE.c1
1 files changed, 1 insertions, 0 deletions
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