This is the mail archive of the
mailing list for the glibc project.
Re: Sticky EOF breaks stream concatenation via dup2 [BZ #23636]
On Mon, Sep 17, 2018 at 05:18:48PM +0200, Florian Weimer wrote:
> Carlos O'Donell <firstname.lastname@example.org> 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