diff options
author | Eric Blake <eblake@redhat.com> | 2011-06-14 03:56:05 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2011-06-14 03:56:05 +0000 |
commit | 4226571d7af401f07fea4797b93c2c888f5e9880 (patch) | |
tree | 27ea4ca682438a63d1cbbe4a7656ad083e99a9a8 /newlib/libc/stdio/local.h | |
parent | 0fdbb2d0cdf86dddcd7c915ab3ef1172c704ecc2 (diff) | |
download | cygnal-4226571d7af401f07fea4797b93c2c888f5e9880.tar.gz cygnal-4226571d7af401f07fea4797b93c2c888f5e9880.tar.bz2 cygnal-4226571d7af401f07fea4797b93c2c888f5e9880.zip |
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.h | 3 |
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) && \ |