This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Thread-safe libgfortran (PRs fortran/14943 and fortran/21647)
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 23 Nov 2005 16:18:42 +1030
- Subject: Re: [PATCH] Thread-safe libgfortran (PRs fortran/14943 and fortran/21647)
- References: <200511230520.jAN5KHq33442@makai.watson.ibm.com>
On Wed, Nov 23, 2005 at 12:20:17AM -0500, David Edelsohn wrote:
> The patch also appears to have reintroduced two regressions on at
> least AIX and PPC Linux.
>
> gfortran.dg/dev_null.f90
> gfortran.dg/write_to_null.f90
>
> are failing with a "File already opened in another unit" error. This
> happens if the tests are run with no controlling terminal, so stdin is
> /dev/null. If I compile the testcases above and run them manually at a
> shell prompt, they succeed. If I run with
>
> $ ./a.out < /dev/null
>
> they fail.
>
> This is suppose to be handled in
> libgfortran/io/open.c:new_unit()
>
> 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))
I think that ought to be u2->unit_number rather than u->unit_number.
Testing...
--
Alan Modra
IBM OzLabs - Linux Technology Centre