summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/open.c7
1 files changed, 7 insertions, 0 deletions
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;