Commit 1ed1c7ce by Alan Modra Committed by Alan Modra

open.c (new_unit): Use the right unit number when checking for stdin, stdout, stderr.

	* io/open.c (new_unit): Use the right unit number when checking
	for stdin, stdout, stderr.

From-SVN: r107413
parent 7d6c1f42
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> 2005-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/24794 PR libgfortran/24794
......
...@@ -339,9 +339,9 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) ...@@ -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) if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) != 0)
u2 = find_file (opp->file, opp->file_len); u2 = find_file (opp->file, opp->file_len);
if (u2 != NULL if (u2 != NULL
&& (options.stdin_unit < 0 || u->unit_number != options.stdin_unit) && (options.stdin_unit < 0 || u2->unit_number != options.stdin_unit)
&& (options.stdout_unit < 0 || u->unit_number != options.stdout_unit) && (options.stdout_unit < 0 || u2->unit_number != options.stdout_unit)
&& (options.stderr_unit < 0 || u->unit_number != options.stderr_unit)) && (options.stderr_unit < 0 || u2->unit_number != options.stderr_unit))
{ {
unlock_unit (u2); unlock_unit (u2);
generate_error (&opp->common, ERROR_ALREADY_OPEN, NULL); generate_error (&opp->common, ERROR_ALREADY_OPEN, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment