aboutsummaryrefslogtreecommitdiffstats
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/socket.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index aedadd09f7..b7c2d977fa 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1467,16 +1467,11 @@ tcp_accept_nonblock(VALUE sock)
OpenFile *fptr;
struct sockaddr_storage from;
socklen_t fromlen;
- VALUE client;
GetOpenFile(sock, fptr);
fromlen = sizeof(from);
- client = s_accept_nonblock(rb_cTCPSocket, fptr,
- (struct sockaddr *)&from, &fromlen);
- if (rb_block_given_p()) {
- return sock_yield(client);
- }
- return client;
+ return s_accept_nonblock(rb_cTCPSocket, fptr,
+ (struct sockaddr *)&from, &fromlen);
}
static VALUE
@@ -1485,15 +1480,10 @@ tcp_sysaccept(VALUE sock)
OpenFile *fptr;
struct sockaddr_storage from;
socklen_t fromlen;
- VALUE client;
GetOpenFile(sock, fptr);
fromlen = sizeof(from);
- client = s_accept(0, fptr->fd, (struct sockaddr*)&from, &fromlen);
- if (rb_block_given_p()) {
- return sock_yield(client);
- }
- return client;
+ return s_accept(0, fptr->fd, (struct sockaddr*)&from, &fromlen);
}
#ifdef HAVE_SYS_UN_H