From 40a43760fddccdc9b5ca636680fc75a08d6a0d49 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 6 Feb 2024 20:17:56 +0100 Subject: [PATCH] Invert this logic to match O_NONBLOCK flag Fixes #8081 --- core/src/main/java/org/jruby/RubyIO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/jruby/RubyIO.java b/core/src/main/java/org/jruby/RubyIO.java index 115c2592799..144660fe82e 100644 --- a/core/src/main/java/org/jruby/RubyIO.java +++ b/core/src/main/java/org/jruby/RubyIO.java @@ -2619,9 +2619,9 @@ private IRubyObject ctl(ThreadContext context, IRubyObject cmd, IRubyObject arg) return runtime.newFixnum(close_on_exec_p(context).isTrue() ? FD_CLOEXEC : 0); } else if (realCmd == Fcntl.F_SETFL.intValue()) { if ((nArg & OpenFlags.O_NONBLOCK.intValue()) != 0) { - fptr.setBlocking(runtime, true); - } else { fptr.setBlocking(runtime, false); + } else { + fptr.setBlocking(runtime, true); } if ((nArg & OpenFlags.O_CLOEXEC.intValue()) != 0) {