OSDN Git Service

2009-08-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Aug 2009 21:10:06 +0000 (21:10 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Aug 2009 21:10:06 +0000 (21:10 +0000)
PR libfortran/32784
io/unix.c (regular_file): Add support for CONIO on mingw.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150779 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/io/unix.c

index 8c7bf86..4ecba3a 100644 (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)