diff options
author | NARUSE, Yui <nurse@users.noreply.github.com> | 2024-02-05 17:41:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 08:41:56 +0000 |
commit | 288d84d827da6cb8a56ed614a9839a06488986c0 (patch) | |
tree | 4bcf966bb1ecdfeb45d2e3b62625218a51a3df41 | |
parent | d7dc57a545d75c01313a9020b162ebb648a3ea18 (diff) |
merge revision(s) 2554c5d3b8738a248cedb2fea96dfab9fbe19417: [Backport #20231] (#9831)
Don't wait in `io_binwrite_string` if not necessary. (#9792)
---
io.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
-rw-r--r-- | io.c | 8 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 4 insertions, 6 deletions
@@ -1795,13 +1795,11 @@ io_binwrite_string(VALUE arg) // Write as much as possible: ssize_t result = io_binwrite_string_internal(p->fptr, ptr, remaining); - // If only the internal buffer is written, result will be zero [bytes of given data written]. This means we - // should try again. if (result == 0) { - errno = EWOULDBLOCK; + // If only the internal buffer is written, result will be zero [bytes of given data written]. This means we + // should try again immediately. } - - if (result > 0) { + else if (result > 0) { if ((size_t)result == remaining) break; ptr += result; remaining -= result; @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 10 +#define RUBY_PATCHLEVEL 11 #include "ruby/version.h" #include "ruby/internal/abi.h" |