This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: 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 <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


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