37c37
< __FBSDID("$FreeBSD: head/lib/libc/stdio/fflush.c 249808 2013-04-23 13:33:13Z emaste $");
---
> __FBSDID("$FreeBSD: head/lib/libc/stdio/fflush.c 268924 2014-07-20 20:05:39Z pfg $");
63c63
< * when passed a file which is not open for reading. According to
---
> * when passed a file which is not open for writing. According to
70a71,73
> * SUSv3 now requires that fflush() returns success on a read-only
> * stream.
> *
72,75c75,77
< if ((fp->_flags & (__SWR | __SRW)) == 0) {
< errno = EBADF;
< retval = EOF;
< } else
---
> if ((fp->_flags & (__SWR | __SRW)) == 0)
> retval = 0;
> else
92,95c94,96
< if ((fp->_flags & (__SWR | __SRW)) == 0) {
< errno = EBADF;
< retval = EOF;
< } else
---
> if ((fp->_flags & (__SWR | __SRW)) == 0)
> retval = 0;
> else
124a126,131
> /* Reset _p and _w. */
> if (p > fp->_p) /* Some was written. */
> memmove(fp->_p, p, n);
> fp->_p += n;
> if ((fp->_flags & (__SLBF | __SNBF)) == 0)
> fp->_w -= n;
< __FBSDID("$FreeBSD: head/lib/libc/stdio/fflush.c 249808 2013-04-23 13:33:13Z emaste $");
---
> __FBSDID("$FreeBSD: head/lib/libc/stdio/fflush.c 268924 2014-07-20 20:05:39Z pfg $");
63c63
< * when passed a file which is not open for reading. According to
---
> * when passed a file which is not open for writing. According to
70a71,73
> * SUSv3 now requires that fflush() returns success on a read-only
> * stream.
> *
72,75c75,77
< if ((fp->_flags & (__SWR | __SRW)) == 0) {
< errno = EBADF;
< retval = EOF;
< } else
---
> if ((fp->_flags & (__SWR | __SRW)) == 0)
> retval = 0;
> else
92,95c94,96
< if ((fp->_flags & (__SWR | __SRW)) == 0) {
< errno = EBADF;
< retval = EOF;
< } else
---
> if ((fp->_flags & (__SWR | __SRW)) == 0)
> retval = 0;
> else
124a126,131
> /* Reset _p and _w. */
> if (p > fp->_p) /* Some was written. */
> memmove(fp->_p, p, n);
> fp->_p += n;
> if ((fp->_flags & (__SLBF | __SNBF)) == 0)
> fp->_w -= n;