diff options
author | Alan Modra <amodra@bigpond.net.au> | 2005-11-23 10:18:11 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2005-11-23 10:18:11 +0000 |
commit | 7714e3adef34dca30322297348344b0b02a8397a (patch) | |
tree | c73226fe410468a152c86d46858bc8c8c43c6776 /libgfortran | |
parent | 4a30377838051e295eb575c3f780ce06bee8d59e (diff) |
* io/open.c (new_unit): Use the right unit number when checking
for stdin, stdout, stderr.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@107413 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/io/open.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index eff28802c23..c777d347c4e 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2005-11-23 Alan Modra <amodra@bigpond.net.au> + + * io/open.c (new_unit): Use the right unit number when checking + for stdin, stdout, stderr. + 2005-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/24794 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); |