summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-25 13:34:21 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-25 13:34:21 +0000
commit1fe90db5380117580ae41be4f3d01686aaa73697 (patch)
treed6f825811bd53f4783879a64360d6ee840cefce0 /io.c
parent96d375540f390579fa93024819fb14ca05b9cd5e (diff)
* io.c (io_binwrite_string): Test writev() failure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;