summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-19 07:48:32 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-19 07:48:32 +0000
commit28aeaa6f674e420c1bf2c35cbe0bf566b7f01de7 (patch)
treeead300989db37caf61cb6dce6c37b9144ff84945 /io.c
parentf2a5cf2254c66a196219d4f38e608ce46be08c46 (diff)
downloadruby-28aeaa6f674e420c1bf2c35cbe0bf566b7f01de7.tar.gz
ruby-28aeaa6f674e420c1bf2c35cbe0bf566b7f01de7.tar.xz
ruby-28aeaa6f674e420c1bf2c35cbe0bf566b7f01de7.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/io.c b/io.c
index 465b3d0a9..4c1691893 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';