From ee87eb1367f14fe43e58dfb9c528de4fd992a260 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Dec 2001 07:48:32 +0000 Subject: * eval.c (rb_mod_define_method): define_method should follow default method visibility. * eval.c (rb_attr): should warn if the default method visibility is "module_function" (can be error). * eval.c (rb_mod_define_method): should define class/module method also if the visibility is "module_function". * eval.c (rb_mod_define_method): should call hook method "method_added", and "singleton_method_added". * string.c: use RESIZE_CAPA for capacity change. * ext/socket/socket.c (Init_socket): add listen method to TCPServer and UNIXServer. * ext/socket/socket.c (bsock_send): should raise EWOULDBLOCK exception. * ext/socket/socket.c (s_recvfrom): ditto. * ext/socket/socket.c (s_accept): ditto. * ext/socket/socket.c (udp_send): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 465b3d0a93..4c16918938 100644 --- a/io.c +++ b/io.c @@ -512,11 +512,16 @@ io_fread(ptr, len, f) if (c == EOF) { eof: if (ferror(f)) { - if (errno == EINTR) continue; - if (errno == EAGAIN) return len - n; + switch (errno) { + case EINTR: + continue; + + case EAGAIN: #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - if (errno == EWOULDBLOCK) return len - n; + case EWOULDBLOCK: #endif + return len - n; + } rb_sys_fail(0); } *ptr = '\0'; -- cgit v1.2.3