This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in freopen


Dave Korn <dave.korn <at> artimi.com> wrote in
http://cygwin.com/ml/cygwin/2005-07/msg00725.html:

> >Sent: 15 July 2005 00:14
> 
> > POSIX requires that freopen(NULL, mode, f) reopen f in the new
> > mode, and allows implementations the option of not even closing
> > f in the first place.
> 
>   I could take a look at this over the weekend if nobody gets to it first :)

Some closure to this old thread - I beat DaveK to the patch, and Jeff just 
installed it into newlib.  So the next snapshot should support freopen
(NULL, "rb", stdin) as a handy way to force stdin into binary mode.  It should 
even be safe when stdin is a tty (you really don't want to be switching ttys 
between binary and text modes, but freopen will take care of that).

--
Eric Blake




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]