aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jblomqvi@cc.hut.fi>2005-10-12 19:54:59 +0000
committerPaul Thomas <pault@gcc.gnu.org>2005-10-12 19:54:59 +0000
commitc611e2bca588610778c82072328146831ec6215a (patch)
tree946205e270ed3be183176e0e152e2858d3d475fa /libgfortran/io/unix.c
parent89453be51a7ab0d2ad72f355f034eba402de600c (diff)
2005-10-12 Janne Blomqvist <jblomqvi@cc.hut.fi>
* io/unix.c: Remove parts of patch of 2005/10/07 that cause input from the terminal to hang. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@105324 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 6fe861c573c..de018af1f03 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -440,7 +440,7 @@ static char *
fd_alloc_r_at (unix_stream * s, int *len, gfc_offset where)
{
gfc_offset m;
- size_t n;
+ int n;
if (where == -1)
where = s->logical_offset;
@@ -462,8 +462,8 @@ fd_alloc_r_at (unix_stream * s, int *len, gfc_offset where)
if (s->physical_offset != m && lseek (s->fd, m, SEEK_SET) < 0)
return NULL;
- n = s->len - s->active;
- if (do_read (s, s->buffer + s->active, &n) != 0)
+ n = read (s->fd, s->buffer + s->active, s->len - s->active);
+ if (n < 0)
return NULL;
s->physical_offset = where + n;