Skip to content

Commit

Permalink
Merge pull request jruby#8090 from headius/invert_fcntl_nonblock
Browse files Browse the repository at this point in the history
Invert this logic to match O_NONBLOCK flag
  • Loading branch information
headius authored Feb 6, 2024
2 parents 861e248 + 40a4376 commit 4e67d1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4e67d1b

Please sign in to comment.