Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/ext/socket/RubyUNIXServer.java
Original file line number Diff line number Diff line change
@@ -129,6 +129,8 @@ public IRubyObject accept_nonblock(ThreadContext context, Ruby runtime, boolean
try {
UnixSocketChannel socketChannel = ((UnixServerSocketChannel) selectable).accept();

if (socketChannel == null) throw runtime.newErrnoEAGAINReadableError("accept(2) would block");

RubyUNIXSocket sock = (RubyUNIXSocket)(Helpers.invoke(context, runtime.getClass("UNIXSocket"), "allocate"));

sock.init_sock(context.runtime, socketChannel, "");

0 comments on commit cc79119

Please sign in to comment.