aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/open.c
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2004-12-08 00:32:39 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2004-12-08 00:32:39 +0000
commit6ecf6dcbb8b4aebb2a7350158bf3a2c4e4173763 (patch)
tree5512e79869e27dabcf560460d558f9e8776f7130 /libgfortran/io/open.c
parent1b79dc38ddc47991e1b111a238162c9f1a5282a8 (diff)
downloadgcc-6ecf6dcbb8b4aebb2a7350158bf3a2c4e4173763.zip
gcc-6ecf6dcbb8b4aebb2a7350158bf3a2c4e4173763.tar.gz
gcc-6ecf6dcbb8b4aebb2a7350158bf3a2c4e4173763.tar.bz2
io.h (open_external): Change prototype.
* io/io.h (open_external): Change prototype. * io/unix.c (regular_file): Change prototype and set flags->action if needed. (open_external): Ditto. * io/open.c (new_unit): Let open_external set flags->action. From-SVN: r91843
Diffstat (limited to 'libgfortran/io/open.c')
-rw-r--r--libgfortran/io/open.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index ef8aad2..28a6bab 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -207,14 +207,13 @@ new_unit (unit_flags * flags)
stream *s;
char tmpname[5 /* fort. */ + 10 /* digits of unit number */ + 1 /* 0 */];
- /* Change unspecifieds to defaults. */
+ /* Change unspecifieds to defaults. Leave (flags->action ==
+ ACTION_UNSPECIFIED) alone so open_external() can set it based on
+ what type of open actually works. */
if (flags->access == ACCESS_UNSPECIFIED)
flags->access = ACCESS_SEQUENTIAL;
- if (flags->action == ACTION_UNSPECIFIED)
- flags->action = ACTION_READWRITE; /* Processor dependent. */
-
if (flags->form == FORM_UNSPECIFIED)
flags->form = (flags->access == ACCESS_SEQUENTIAL)
? FORM_FORMATTED : FORM_UNFORMATTED;
@@ -325,7 +324,7 @@ new_unit (unit_flags * flags)
/* Open file. */
- s = open_external (flags->action, flags->status);
+ s = open_external (flags);
if (s == NULL)
{
generate_error (ERROR_OS, NULL);