summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 91aa53c163..09326ce16f 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -499,11 +499,15 @@ bsock_send(argc, argv, sock)
rb_thread_fd_writable(fd);
retry:
if (!NIL_P(to)) {
+ TRAP_BEG;
n = sendto(fd, RSTRING(mesg)->ptr, RSTRING(mesg)->len, NUM2INT(flags),
(struct sockaddr*)RSTRING(to)->ptr, RSTRING(to)->len);
+ TRAP_END;
}
else {
+ TRAP_BEG;
n = send(fd, RSTRING(mesg)->ptr, RSTRING(mesg)->len, NUM2INT(flags));
+ TRAP_END;
}
if (n < 0) {
if (rb_io_wait_writable(fd)) {