aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2015-01-23 02:01:10 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2015-01-23 02:01:10 +0000
commitbb295963d4099db5c2822140430e950ac7f78894 (patch)
tree256f68a04ba24948b248589c8686f27ea8f05fd4 /libgfortran
parente344505cec510fe08af6c3263fc10619295ccd45 (diff)
downloadgcc-bb295963d4099db5c2822140430e950ac7f78894.zip
gcc-bb295963d4099db5c2822140430e950ac7f78894.tar.gz
gcc-bb295963d4099db5c2822140430e950ac7f78894.tar.bz2
re PR fortran/61933 (Inquire on internal units)
2015-01-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/61933 * io/inquire.c (inquire_via_unit): Set existing to true for any negative unit that is currently connected and any positive units within range of KIND=4 value. The unit value for any out of range case that may occur if the user is using a KIND=8 will have been set to -2 which is reserved and can never be opened, and therefore the unit does not exist. From-SVN: r220024
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog10
-rw-r--r--libgfortran/io/inquire.c4
2 files changed, 12 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 33fb6da..04f85c7 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,13 @@
+2015-01-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/61933
+ * io/inquire.c (inquire_via_unit): Set existing to true for
+ any negative unit that is currently connected and any positive
+ units within range of KIND=4 value. The unit value for any out
+ of range case that may occur if the user is using a KIND=8 will
+ have been set to -2 which is reserved and can never be opened,
+ and therefore the unit does not exist.
+
2015-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/61933
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c
index 21367a6..a5f362e 100644
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -41,11 +41,11 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
const char *p;
GFC_INTEGER_4 cf = iqp->common.flags;
- if (iqp->common.unit == -1)
+ if (iqp->common.unit == GFC_INTERNAL_UNIT)
generate_error (&iqp->common, LIBERROR_INQUIRE_INTERNAL_UNIT, NULL);
if ((cf & IOPARM_INQUIRE_HAS_EXIST) != 0)
- *iqp->exist = (u != NULL);
+ *iqp->exist = (u != NULL) || (iqp->common.unit >= 0);
if ((cf & IOPARM_INQUIRE_HAS_OPENED) != 0)
*iqp->opened = (u != NULL);