aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2005-12-28 20:58:08 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2005-12-28 20:58:08 +0000
commit27b1286fb9bf8c58930b81339c9001aa39683ca9 (patch)
treeb63a6a30c0af2c94fb6a30da53a4f61a383ada74 /libgfortran
parentb130803b72b77c02cee4d4ff763eba200f9f8e58 (diff)
2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/25139 * io/unix.c (fd_truncate): Set s->active to zero. PR libgfortran/25510 * libgfortran.h: Add ERROR_INTERNAL and ERROR_INTERNAL_UNIT. * runtime/error.c (translate_error): Add messages for new errors. * io/list_read.c (next_char): Use new errors. * io/transfer.c (next_record_r) (next_record_w): Use new errors. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@109122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog10
-rw-r--r--libgfortran/io/list_read.c2
-rw-r--r--libgfortran/io/transfer.c7
-rw-r--r--libgfortran/io/unix.c2
-rw-r--r--libgfortran/libgfortran.h2
-rw-r--r--libgfortran/runtime/error.c8
6 files changed, 27 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index c9fdb6bc30c..d60193afb58 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,15 @@
2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ PR libgfortran/25139
+ * io/unix.c (fd_truncate): Set s->active to zero.
+ PR libgfortran/25510
+ * libgfortran.h: Add ERROR_INTERNAL and ERROR_INTERNAL_UNIT.
+ * runtime/error.c (translate_error): Add messages for new errors.
+ * io/list_read.c (next_char): Use new errors.
+ * io/transfer.c (next_record_r) (next_record_w): Use new errors.
+
+2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
PR libgfortran/25550
* io/file_pos.c (st_rewind): Reset bytes left so no error occurs in
next_record_r.
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b11f6a523ff..879cf8f3230 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -164,7 +164,7 @@ next_char (st_parameter_dt *dtp)
check for NULL here is cautionary. */
if (p == NULL)
{
- generate_error (&dtp->common, ERROR_OS, NULL);
+ generate_error (&dtp->common, ERROR_INTERNAL_UNIT, NULL);
return '\0';
}
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 7ad1fffc68d..2c12294398e 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1702,7 +1702,7 @@ next_record_r (st_parameter_dt *dtp)
record = record * dtp->u.p.current_unit->recl;
if (sseek (dtp->u.p.current_unit->s, record) == FAILURE)
{
- generate_error (&dtp->common, ERROR_OS, NULL);
+ generate_error (&dtp->common, ERROR_INTERNAL_UNIT, NULL);
break;
}
dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
@@ -1863,7 +1863,10 @@ next_record_w (st_parameter_dt *dtp, int done)
record = record * dtp->u.p.current_unit->recl;
if (sseek (dtp->u.p.current_unit->s, record) == FAILURE)
- goto io_error;
+ {
+ generate_error (&dtp->common, ERROR_INTERNAL_UNIT, NULL);
+ return;
+ }
dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
}
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 6750b6f6142..237f09e9930 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -601,7 +601,7 @@ fd_truncate (unix_stream * s)
}
s->physical_offset = s->file_length = s->logical_offset;
-
+ s->active = 0;
return SUCCESS;
}
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index aacc7b8c8c5..b64b60b1894 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -407,6 +407,8 @@ typedef enum
ERROR_BAD_US,
ERROR_READ_VALUE,
ERROR_READ_OVERFLOW,
+ ERROR_INTERNAL,
+ ERROR_INTERNAL_UNIT,
ERROR_LAST /* Not a real error, the last error # + 1. */
}
error_codes;
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c
index 7f85b5ceb3a..2d3c0689adc 100644
--- a/libgfortran/runtime/error.c
+++ b/libgfortran/runtime/error.c
@@ -423,6 +423,14 @@ translate_error (int code)
p = "Numeric overflow on read";
break;
+ case ERROR_INTERNAL:
+ p = "Internal error in run-time library";
+ break;
+
+ case ERROR_INTERNAL_UNIT:
+ p = "Internal unit I/O error";
+ break;
+
default:
p = "Unknown error code";
break;