This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[Patch, libgfortran] [4.4/4.5 Regression] Endless loop in internal write


The following simple patch fixes this regression and passes regression testing.

I plan to commit as simple and obvious to 4.5 and 4.4. Regression tested on x96-64-linux-gnu.

Thanks for the report.

Regards,

Jerry

2009-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR libfortran/40576
	* io/transfer.c (sset): Adjust exit condition for loop.


Index: io/transfer.c =================================================================== --- io/transfer.c (revision 149073) +++ io/transfer.c (working copy) @@ -2867,7 +2867,7 @@ sset (stream * s, int c, ssize_t nbyte) { trans = (bytes_left < WRITE_CHUNK) ? bytes_left : WRITE_CHUNK; trans = swrite (s, p, trans); - if (trans < 0) + if (trans <= 0) return trans; bytes_left -= trans; }



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