From 4efccd28e4b257fb1c8f97781d0b5b1c42c1d9fa Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 9 May 2022 22:36:33 +1200 Subject: Improve consistency of `io_binwritev_internal` implementaiton. --- io.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index c222dd5377..30fb42d932 100644 --- a/io.c +++ b/io.c @@ -1940,13 +1940,11 @@ io_binwritev_internal(VALUE arg) iov->iov_base = (char *)iov->iov_base + result; iov->iov_len -= result; - - errno = EAGAIN; } - - if (rb_io_maybe_wait_writable(errno, fptr->self, Qnil)) { + else if (rb_io_maybe_wait_writable(errno, fptr->self, Qnil)) { rb_io_check_closed(fptr); - } else { + } + else { return -1; } } -- cgit v1.2.3