From ee08592d029fdb8fcaab6eafded3d5bc22804d41 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 8 Jan 2000 05:00:25 +0000 Subject: 2000-01-08 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index 1e8471756..9bc1c6014 100644 --- a/io.c +++ b/io.c @@ -454,7 +454,9 @@ io_fread(ptr, len, f) if (!READ_DATA_PENDING(f)) { rb_thread_wait_fd(fileno(f)); } + TRAP_BEG; c = getc(f); + TRAP_END; if (c == EOF) { *ptr = '\0'; break; @@ -1456,7 +1458,8 @@ pipe_open(pname, mode) pipe_add_fptr(fptr); if (modef & FMODE_READABLE) fptr->f = f; if (modef & FMODE_WRITABLE) { - fptr->f2 = f; + if (fptr->f) fptr->f2 = f; + else fptr->f = f; rb_io_synchronized(fptr); } return (VALUE)port; -- cgit