diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2009-08-14 21:10:06 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2009-08-14 21:10:06 +0000 |
commit | 37d1bbbc62c35efaa1a590e98252ce8190ec5aee (patch) | |
tree | 6a2ea8e41121d3b476c59187ee57d56e9b8516af | |
parent | b874a90d6dda3e9e841025329f1468268bcaccdf (diff) | |
download | gcc-37d1bbbc62c35efaa1a590e98252ce8190ec5aee.zip gcc-37d1bbbc62c35efaa1a590e98252ce8190ec5aee.tar.gz gcc-37d1bbbc62c35efaa1a590e98252ce8190ec5aee.tar.bz2 |
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
-rw-r--r-- | libgfortran/io/unix.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 8c7bf86..4ecba3a 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -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) |