diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-22 03:10:24 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-22 03:10:24 +0000 |
commit | cfc2ab99bfa64ba605a0136c4d21473e3b10f323 (patch) | |
tree | 8ebf00fd8e3f39fccd1b3a4dd4ea6f91237c030f /libgfortran | |
parent | 6838dace8ea5898c80589de2d63f58fa01cdc777 (diff) | |
download | gcc-cfc2ab99bfa64ba605a0136c4d21473e3b10f323.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 9 | ||||
-rw-r--r-- | libgfortran/io/open.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index bd4243f0828..8411513a819 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index be8f4bb0b43..d7448c007f1 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -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; } |