Skip to content

Commit

Permalink
Fix altered behavior for UNIXServer#accept_nonblock.
Browse files Browse the repository at this point in the history
This broke due to fixing jnr-unixsocket to return null on failed
nonblocking accept.
  • Loading branch information
headius committed Sep 29, 2016
1 parent d9090c3 commit cc79119
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
Expand Up @@ -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, "");
Expand Down

0 comments on commit cc79119

Please sign in to comment.