]> sourceware.org Git - newlib-cygwin.git/commit
Update setvbuf to latest OpenBSD implementation
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 12 Mar 2016 22:41:21 +0000 (23:41 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 12 Mar 2016 22:41:21 +0000 (23:41 +0100)
commit1eb6db6efb29b41d696db97a95aaaeee2b84c768
tree89846c53aef688e9e5ce46d834de9063cba8f0e1
parent99d0e2341d3ff37b98eff9163b195b715ff8bddf
Update setvbuf to latest OpenBSD implementation

Newlib's setvbuf function is very old and has two bugs:
- It sets the SRD/SWR flags incorrectly in case of files opened for
  reading and writing.
  See https://cygwin.com/ml/cygwin/2016-03/msg00180.html
  for a desription of the effect.
- It always sets the buffer size to BUFSIZ if it's not provided by
  the application, independent of the optimal blocksize for the
  underlying IO device.

Update setvbuf to latest code from OpenBSD to fix both problems.

* libc/stdio/setvbuf.c (setvbuf): Import latest OpenBSD
implementation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
newlib/libc/stdio/setvbuf.c
This page took 0.02573 seconds and 5 git commands to generate.