Commit d8771b59 by Jerry DeLisle

re PR libfortran/32784 ([win32] Using 'CONOUT$', 'CONIN$', or 'CONERR$' as…

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

2009-07-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/32784
	* unix.c (regular_file): Check for CONIN$ CONOUT$, and CONERR$ and open
	the respective /dev/conin or /dev/conout devices.  This is Cygwin
	specific.

From-SVN: r149970
parent 1f8260a0
2009-07-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/32784
* unix.c (regular_file): Check for CONIN$ CONOUT$, and CONERR$ and open
the respective /dev/conin or /dev/conout devices. This is Cygwin
specific.
2009-07-19 Thomas Koenig <tkoenig@gcc.gnu.org> 2009-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34670 PR libfortran/34670
......
...@@ -897,6 +897,26 @@ regular_file (st_parameter_open *opp, unit_flags *flags) ...@@ -897,6 +897,26 @@ regular_file (st_parameter_open *opp, unit_flags *flags)
return -1; return -1;
} }
#ifdef __CYGWIN__
if (opp->file_len == 7)
{
if (strncmp (path, "CONOUT$", 7) == 0
|| strncmp (path, "CONERR$", 7) == 0)
{
fd = open ("/dev/conout", O_WRONLY);
flags->action = ACTION_WRITE;
return fd;
}
}
if (opp->file_len == 6 && strncmp (path, "CONIN$", 6) == 0)
{
fd = open ("/dev/conin", O_RDONLY);
flags->action = ACTION_READ;
return fd;
}
#endif
rwflag = 0; rwflag = 0;
switch (flags->action) switch (flags->action)
......
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