summaryrefslogtreecommitdiff
path: root/ext/socket/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/init.c')
-rw-r--r--ext/socket/init.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 317dd67..455652d 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)