diff options
| author | nagachika <nagachika@ruby-lang.org> | 2024-03-31 17:16:26 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2024-03-31 17:16:26 +0900 |
| commit | bf6e9299ef4f10dbd23f32331c355ac875bfb5e3 (patch) | |
| tree | 05ca549941916a87f96726cfb20185f2504e5569 | |
| parent | d5dbada8a2127d9b6b670dd891eabbb63c48268f (diff) | |
merge revision(s) 2554c5d3b8738a248cedb2fea96dfab9fbe19417: [Backport #20231]
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
@@ -1789,13 +1789,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 3 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 161 +#define RUBY_PATCHLEVEL 162 #include "ruby/version.h" #include "ruby/internal/abi.h" |
