This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40576] [4.4, 4.5 Regression] Endless loop in internal write
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jun 2009 04:35:17 -0000
- Subject: [Bug fortran/40576] [4.4, 4.5 Regression] Endless loop in internal write
- References: <bug-40576-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2009-06-29 04:35 -------
I think this fixes it. Still testing. Will need to get this into 4.4 if this
is it. This fix is consistent with fd_set in 4.3 which loops as long as trans
> 0. (similar code)
Index: transfer.c
===================================================================
--- transfer.c (revision 149044)
+++ 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;
}
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.5.0 |4.5.0 4.4.1
Summary|[4.5 Regression] Endless |[4.4, 4.5 Regression]
|loop in internal write |Endless loop in internal
| |write
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40576