unix.c: Remove parts of patch of 2005/10/07 that cause input from the terminal to...
authorJanne Blomqvist <jblomqvi@cc.hut.fi>
Wed, 12 Oct 2005 19:54:59 +0000 (22:54 +0300)
committerPaul Thomas <pault@gcc.gnu.org>
Wed, 12 Oct 2005 19:54:59 +0000 (19:54 +0000)
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.

From-SVN: r105324

libgfortran/ChangeLog
libgfortran/io/unix.c

index cca3bbe90807bef629b53a3dcdf6c58576458033..34072892ff3c3554c6fdc3601f4cc7b60a07399b 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2005-10-11  Steven G. Kargl  <kargls@comcast.net>
 
        PR libgfortran/24313
index 6fe861c573cfec867192a243d9156ae3f07fcf2c..de018af1f032dba5e588dca6a6d2a2182251e1ed 100644 (file)
@@ -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;