summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 3a0cc01e04..290e8b1de3 100644
--- a/io.c
+++ b/io.c
@@ -1276,6 +1276,9 @@ io_binwrite_string(VALUE arg)
r = rb_writev_internal(fptr->fd, iov, 2);
+ if (r == -1)
+ return -1;
+
if (fptr->wbuf.len <= r) {
r -= fptr->wbuf.len;
fptr->wbuf.off = 0;