Sticky EOF breaks stream concatenation via dup2 [BZ #23636]

Rich Felker dalias@libc.org
Mon Sep 17 15:26:00 GMT 2018


On Mon, Sep 17, 2018 at 05:18:48PM +0200, Florian Weimer wrote:
> Carlos O'Donell <carlos@redhat.com> writes:
> 
> > Is cups-filter fixed by inserting a clearerr(f)?
> 
> The proposed fix uses rewind, which is equivalent in this case and
> presumably more portable.

I think clearerr is better. rewind is essentially specified as
clearerr(f)+fseek(f,0,SEEK_SET), and in general the extra seek may be
undesirable. Both interfaces are plain C and have been since C89 or
earlier.

Rich



More information about the Libc-alpha mailing list