aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io.c b/io.c
index 51c2ffcadc..04e46e085d 100644
--- a/io.c
+++ b/io.c
@@ -2256,7 +2256,9 @@ rb_io_syswrite(VALUE io, VALUE str)
if (!rb_thread_fd_writable(fptr->fd)) {
rb_io_check_closed(fptr);
}
+ TRAP_BEG;
n = write(fptr->fd, RSTRING(str)->ptr, RSTRING(str)->len);
+ TRAP_END;
if (n == -1) rb_sys_fail(fptr->path);