From 790dc105cd3d099e96a4d4cdf059cbd1a38ca78b Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 18 Sep 2005 18:22:44 +0000 Subject: * file.c (rb_thread_flock): wrap the flock system call by TRAP_BEG/TRAP_END to enable signals. [ruby-dev:27122] * ext/socket/socket.c (bsock_send): wrap the sendto and send system call by TRAP_BEG/TRAP_END to enable signals when writing to a socket which is full. [ruby-dev:27132] * io.c (rb_io_syswrite): wrap the write system call by TRAP_BEG/TRAP_END to enable signals when writing to a pipe which is full. [ruby-dev:27134] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/socket.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext') diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 91aa53c16..09326ce16 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)) { -- cgit