summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-11 05:56:20 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-11 05:56:20 +0000
commit5100ec9c10989dfa81f8ce479a5d56816339443b (patch)
treec9dbad5660c861798c7ad9d3bddd154215a4d446 /libgfortran
parent91de3cd6ac9dcf65a7f5f3450ee951f285fabf49 (diff)
downloadgcc-5100ec9c10989dfa81f8ce479a5d56816339443b.tar.gz
PR libfortran/21471
* open.c (new_unit): Take care of the case where POSITION_APPEND is specified (sseek to the end, and set u>-endfile). * gfortran.dg/append-1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99560 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/open.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 95884c1891c..fa866a1091f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-10 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR libfortran/21471
+ * open.c (new_unit): Take care of the case where POSITION_APPEND
+ is specified (sseek to the end, and set u>-endfile).
+
2005-05-10 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/20178
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index 82a862b7c47..97bf6e4cc3d 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -356,6 +356,13 @@ new_unit (unit_flags * flags)
u->s = s;
u->flags = *flags;
+ if (flags->position == POSITION_APPEND)
+ {
+ if (sseek (u->s, file_length (u->s)) == FAILURE)
+ generate_error (ERROR_OS, NULL);
+ u->endfile = AT_ENDFILE;
+ }
+
/* Unspecified recl ends up with a processor dependent value. */
u->recl = (ioparm.recl_in != 0) ? ioparm.recl_in : g.max_offset;