aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
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
commit844234fb50d86f0e03b6645bf40011d45a8ae65c (patch)
treeb63a6a30c0af2c94fb6a30da53a4f61a383ada74 /libgfortran/io
parentff7417d4c9b74b85cfb17000718b245b2aa96cb5 (diff)
downloadgcc-844234fb50d86f0e03b6645bf40011d45a8ae65c.zip
gcc-844234fb50d86f0e03b6645bf40011d45a8ae65c.tar.gz
gcc-844234fb50d86f0e03b6645bf40011d45a8ae65c.tar.bz2
re PR libfortran/25139 ("Invalid argument" error on I/O)
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. From-SVN: r109122
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/list_read.c2
-rw-r--r--libgfortran/io/transfer.c7
-rw-r--r--libgfortran/io/unix.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b11f6a5..879cf8f 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 7ad1fffc..2c12294 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 6750b6f..237f09e 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;
}