From 4226571d7af401f07fea4797b93c2c888f5e9880 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 14 Jun 2011 03:56:05 +0000 Subject: 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. --- newlib/libc/stdio/fvwrite.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'newlib/libc/stdio/fvwrite.c') diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c index d3878dc17..f196b3cfe 100644 --- a/newlib/libc/stdio/fvwrite.c +++ b/newlib/libc/stdio/fvwrite.c @@ -61,11 +61,7 @@ _DEFUN(__sfvwrite_r, (ptr, fp, uio), /* make sure we can write */ if (cantwrite (ptr, fp)) - { - fp->_flags |= __SERR; - ptr->_errno = EBADF; - return EOF; - } + return EOF; iov = uio->uio_iov; len = 0; -- cgit v1.2.3