diff options
Diffstat (limited to 'ext/socket/init.c')
-rw-r--r-- | ext/socket/init.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c index 317dd67479..455652d082 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -211,7 +211,10 @@ rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type str = rb_tainted_str_new(0, buflen); rb_io_check_closed(fptr); - rb_io_set_nonblock(fptr); + + if (!MSG_DONTWAIT_RELIABLE) + rb_io_set_nonblock(fptr); + len0 = alen; slen = recvfrom(fd, RSTRING_PTR(str), buflen, flags, &buf.addr, &alen); if (slen != -1 && len0 < alen) |