PR libfortran/45723
* io/open.c (new_unit): On POSITION_APPEND don't seek if file length is
zero.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164507
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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.
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;
}