Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-06-14 07:56:05 +0400
committerEric Blake <eblake@redhat.com>2011-06-14 07:56:05 +0400
commit4226571d7af401f07fea4797b93c2c888f5e9880 (patch)
tree27ea4ca682438a63d1cbbe4a7656ad083e99a9a8 /newlib/libc/stdio/local.h
parent0fdbb2d0cdf86dddcd7c915ab3ef1172c704ecc2 (diff)
printf: set errno for read-only stream
* libc/stdio/wsetup.c (__swsetup_r): Set errno on failure. * libc/stdio/fvwrite.c (__sfvwrite_r): Simplify. * libc/stdio/wbuf.c (__swbuf_r): Likewise. * libc/stdio/local.h (cantwrite): Adjust comment.
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r--newlib/libc/stdio/local.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index 9ca948d96..187f7d858 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -113,7 +113,8 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *,
} \
while (0)
-/* Return true iff the given FILE cannot be written now. */
+/* Return true and set errno and stream error flag iff the given FILE
+ cannot be written now. */
#define cantwrite(ptr, fp) \
((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \