aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-07-23 00:58:46 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-07-23 00:58:46 +0000
commitd8771b59b77c8e469a19f6496b1025a8ad75d4f3 (patch)
tree7d06a4c6da999ce63065afecdfe7cade74ff43f6 /libgfortran/io/unix.c
parent1f8260a03924e19733d76fed622bf619cd39bf18 (diff)
downloadgcc-d8771b59b77c8e469a19f6496b1025a8ad75d4f3.zip
gcc-d8771b59b77c8e469a19f6496b1025a8ad75d4f3.tar.gz
gcc-d8771b59b77c8e469a19f6496b1025a8ad75d4f3.tar.bz2
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
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index a7eb4e3..8c7bf86 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -897,6 +897,26 @@ regular_file (st_parameter_open *opp, unit_flags *flags)
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;
switch (flags->action)