re PR libfortran/32784 ([win32] Using 'CONOUT$', 'CONIN$', or 'CONERR$' as assigned file generates Fortran runtime error: Bad file descriptor)

2009-08-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/32784
	io/unix.c (regular_file): Add support for CONIO on mingw.

From-SVN: r150779
This commit is contained in:
Jerry DeLisle 2009-08-14 21:10:06 +00:00
parent b874a90d6d
commit 37d1bbbc62
1 changed files with 21 additions and 0 deletions

View File

@ -917,6 +917,27 @@ regular_file (st_parameter_open *opp, unit_flags *flags)
}
#endif
#ifdef __MINGW32__
if (opp->file_len == 7)
{
if (strncmp (path, "CONOUT$", 7) == 0
|| strncmp (path, "CONERR$", 7) == 0)
{
fd = open ("CONOUT$", O_WRONLY);
flags->action = ACTION_WRITE;
return fd;
}
}
if (opp->file_len == 6 && strncmp (path, "CONIN$", 6) == 0)
{
fd = open ("CONIN$", O_RDONLY);
flags->action = ACTION_READ;
return fd;
}
#endif
rwflag = 0;
switch (flags->action)