summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-18 18:22:44 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-18 18:22:44 +0000
commit5b2eef31aa2f783a3f6e4418e4879cd8fb42bcc7 (patch)
treef33f27b4db42b53f0604e64ab63195a041f233f7 /file.c
parent94636e83dc72518ff26d18ce248bd9fa1f87c234 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index 818d8087be..0f35ec0743 100644
--- a/file.c
+++ b/file.c
@@ -2915,7 +2915,11 @@ rb_thread_flock(fd, op, fptr)
OpenFile *fptr;
{
if (rb_thread_alone() || (op & LOCK_NB)) {
- return flock(fd, op);
+ int ret;
+ TRAP_BEG;
+ ret = flock(fd, op);
+ TRAP_END;
+ return ret;
}
op |= LOCK_NB;
while (flock(fd, op) < 0) {