From c43795c6648546eecf92e22150b7e478e63e1a31 Mon Sep 17 00:00:00 2001 From: ksss Date: Sun, 21 May 2017 16:58:57 +0900 Subject: Should raise SyscallError on IO#syswrite instead of IOError --- src/io.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/io.c b/src/io.c index 51a659f0e..452a61a3f 100644 --- a/src/io.c +++ b/src/io.c @@ -705,6 +705,9 @@ mrb_io_syswrite(mrb_state *mrb, mrb_value io) fd = fptr->fd2; } length = write(fd, RSTRING_PTR(buf), RSTRING_LEN(buf)); + if (length == -1) { + mrb_sys_fail(mrb, 0); + } return mrb_fixnum_value(length); } -- cgit v1.2.3