diff options
author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-23 10:18:11 +0000 |
---|---|---|
committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-23 10:18:11 +0000 |
commit | 4cd772728e517f0cafb4449155640b82122f0b3e (patch) | |
tree | c73226fe410468a152c86d46858bc8c8c43c6776 /libgfortran/io | |
parent | 1abe0367da0b7e47c288db313000d97a7190e0ad (diff) | |
download | gcc-4cd772728e517f0cafb4449155640b82122f0b3e.tar.gz |
* io/open.c (new_unit): Use the right unit number when checking
for stdin, stdout, stderr.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107413 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/open.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index a1bc99b70eb..54595097049 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -339,9 +339,9 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) != 0) u2 = find_file (opp->file, opp->file_len); if (u2 != NULL - && (options.stdin_unit < 0 || u->unit_number != options.stdin_unit) - && (options.stdout_unit < 0 || u->unit_number != options.stdout_unit) - && (options.stderr_unit < 0 || u->unit_number != options.stderr_unit)) + && (options.stdin_unit < 0 || u2->unit_number != options.stdin_unit) + && (options.stdout_unit < 0 || u2->unit_number != options.stdout_unit) + && (options.stderr_unit < 0 || u2->unit_number != options.stderr_unit)) { unlock_unit (u2); generate_error (&opp->common, ERROR_ALREADY_OPEN, NULL); |