summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNARUSE, Yui <nurse@users.noreply.github.com>2024-02-05 17:41:56 +0900
committerGitHub <noreply@github.com>2024-02-05 08:41:56 +0000
commit288d84d827da6cb8a56ed614a9839a06488986c0 (patch)
tree4bcf966bb1ecdfeb45d2e3b62625218a51a3df41
parentd7dc57a545d75c01313a9020b162ebb648a3ea18 (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.c8
-rw-r--r--version.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/io.c b/io.c
index a34c457140..ca2cb904ee 100644
--- a/io.c
+++ b/io.c
@@ -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;
diff --git a/version.h b/version.h
index d5097e2003..287f5004b3 100644
--- a/version.h
+++ b/version.h
@@ -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"