[PATCH] prevent retries on fclose/fflush after write errors

Mike Frysinger vapier at gentoo.org
Tue Mar 13 05:43:36 UTC 2012

On Sunday 11 March 2012 20:50:27 Denys Vlasenko wrote:
> On Sunday 11 March 2012 18:10, Rich Felker wrote:
> > On Sun, Mar 11, 2012 at 04:12:19PM +0100, Denys Vlasenko wrote:
> > > On Sunday 11 March 2012 14:46, Denys Vlasenko wrote:
> > > > I propose the following patch.
> > > > Only compile tested by me, care to run-test?
> > > 
> > > A more correct (I hope) version:
> > I'm curious why this is such a big patch introducing new functions and
> > struct members. Couldn't it be just a one-line change in the function
> > that writes out the buffers (i.e. do the buffer-voiding as soon as the
> > error is hit rather than testing for it later)?
> EINTR and EAGAIN should not result in output buffers being dropped.
> You need to remember the error code for this.

should not, but fairly certain POSIX allows us to.  i'd note that glibc 
handles EINTR/EAGAIN in their fwrite/fread loops so that higher code doesn't 
have to write "safe_fwrite" like they do with "safe_read".  would be nice if 
uClibc could provide this too if it's not too much overhead.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20120313/43ada3b9/attachment.asc>

More information about the uClibc mailing list