summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 34a5da317d..b50959c847 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1279,8 +1279,8 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
}
if (ss == -1) {
- if (nonblock && errno == EWOULDBLOCK)
- rb_sys_fail("sendmsg(2) WANT_WRITE");
+ if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
+ rb_mod_sys_fail(rb_mWaitWritable, "sendmsg(2) would block");
rb_sys_fail("sendmsg(2)");
}
@@ -1564,8 +1564,8 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
}
if (ss == -1) {
- if (nonblock && errno == EWOULDBLOCK)
- rb_sys_fail("recvmsg(2) WANT_READ");
+ if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
+ rb_mod_sys_fail(rb_mWaitReadable, "recvmsg(2) would block");
#if defined(HAVE_ST_MSG_CONTROL)
if (!gc_done && (errno == EMFILE || errno == EMSGSIZE)) {
/*