summaryrefslogtreecommitdiff
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 78333d1d22..2c2fa80f15 100644
--- a/io.c
+++ b/io.c
@@ -2331,7 +2331,9 @@ rb_io_syswrite(io, str)
if (!rb_thread_fd_writable(fileno(f))) {
rb_io_check_closed(fptr);
}
+ TRAP_BEG;
n = write(fileno(f), RSTRING(str)->ptr, RSTRING(str)->len);
+ TRAP_END;
if (n == -1) rb_sys_fail(fptr->path);