From: matz@... (Yukihiro Matsumoto) Date: 2003-08-03T02:59:24+09:00 Subject: Re: 1.8.0-previewX rb_sys_fail() on socket instead of an Exception. Hi, In message "Re: 1.8.0-previewX rb_sys_fail() on socket instead of an Exception." on 03/08/03, ts writes: | Well, server.rb is | | loop { | begin | line = socket.gets | puts line | rescue | end | } | | When the client die : the first #gets return EOF, ruby call rb_sys_fail() | but the error is discarded because there is a rescue. | | When ruby call #gets for the second time, it return EOF and errno is not | set but ferror() give an error. Aha, I understand. If I move clearerr() before rb_sys_fail(), will it solve the problem? matz. --- io.c 1 Aug 2003 07:23:00 -0000 1.227 +++ io.c 2 Aug 2003 17:59:02 -0000 @@ -910,5 +910,5 @@ appendline(fptr, delim, strp) if (ferror(f)) { + clearerr(f); if (!rb_io_wait_readable(fileno(f))) rb_sys_fail(fptr->path); - clearerr(f); continue;