diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-05-07 19:48:40 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-05-07 19:48:40 +0000 |
commit | 25a5e75613af9aac60b3c5b6856d6b6819b1ccae (patch) | |
tree | 986b5101c17bfab4371276f257fdb9c143ab5053 /libgfortran | |
parent | adcbdf5c45c75205b243c0a9abc39e4e6685d677 (diff) | |
download | gcc-25a5e75613af9aac60b3c5b6856d6b6819b1ccae.zip gcc-25a5e75613af9aac60b3c5b6856d6b6819b1ccae.tar.gz gcc-25a5e75613af9aac60b3c5b6856d6b6819b1ccae.tar.bz2 |
re PR libfortran/31607 (CALL SYSTEM produces garbled output when writing to a buffered file)
PR libfortran/31607
* intrinsics/system.c (system_sub): Call flush_all_units.
* io/io.h (flush_all_units): Move prototype to libgfortran.h.
* libgfortran.h (flush_all_units): Add prototype.
From-SVN: r124510
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/intrinsics/system.c | 3 | ||||
-rw-r--r-- | libgfortran/io/io.h | 3 | ||||
-rw-r--r-- | libgfortran/libgfortran.h | 5 |
4 files changed, 15 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 24cf929..18118d8 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2007-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR libfortran/31607 + * intrinsics/system.c (system_sub): Call flush_all_units. + * io/io.h (flush_all_units): Move prototype to libgfortran.h. + * libgfortran.h (flush_all_units): Add prototype. + 2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/31201 diff --git a/libgfortran/intrinsics/system.c b/libgfortran/intrinsics/system.c index 73f9371..49a5ba2 100644 --- a/libgfortran/intrinsics/system.c +++ b/libgfortran/intrinsics/system.c @@ -49,6 +49,9 @@ system_sub (const char *fcmd, GFC_INTEGER_4 *status, gfc_charlen_type cmd_len) char cmd[cmd_len + 1]; int stat; + /* Flush all I/O units before executing the command. */ + flush_all_units(); + memcpy (cmd, fcmd, cmd_len); cmd[cmd_len] = '\0'; diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 181c181..a1138cf 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -586,9 +586,6 @@ internal_proto(compare_file_filename); extern gfc_unit *find_file (const char *file, gfc_charlen_type file_len); internal_proto(find_file); -extern void flush_all_units (void); -internal_proto(flush_all_units); - extern int stream_at_bof (stream *); internal_proto(stream_at_bof); diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index bfbfbef..0f7d2c7 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -666,6 +666,11 @@ internal_proto(fstrcpy); extern void cf_strcpy (char *, int, const char *); internal_proto(cf_strcpy); +/* io/intrinsics.c */ + +extern void flush_all_units (void); +internal_proto(flush_all_units); + /* io.c */ extern void init_units (void); |