Commit 3bddec9b by Jerry DeLisle

re PR libfortran/45723 (opening /dev/null for appending writes)

2010-09-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/45723
	* io/open.c (new_unit): On POSITION_APPEND don't seek if file length is
	zero.

From-SVN: r164507
parent efd6aa2f
2010-09-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/45723
* io/open.c (new_unit): On POSITION_APPEND don't seek if file length is
zero.
2010-09-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/45532
......@@ -6,7 +12,8 @@
2010-09-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsics/pack_generic.c (pack): Add missing return and fix whitespace.
* intrinsics/pack_generic.c (pack): Add missing return and fix
whitespace.
* intrinsics/cshift0.c (cshift0): Fix whitespace.
* intrinsics/unpack_generic.c (unpack1, unpack0): Fix whitespace.
......
......@@ -555,7 +555,7 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags)
if (flags->position == POSITION_APPEND)
{
if (sseek (u->s, 0, SEEK_END) < 0)
if (file_size (opp->file, opp->file_len) > 0 && sseek (u->s, 0, SEEK_END) < 0)
generate_error (&opp->common, LIBERROR_OS, NULL);
u->endfile = AT_ENDFILE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment