Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/src/main/java/org/jruby/util/io/FilenoUtil.java
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import com.headius.modulator.Modulator;
import jnr.enxio.channels.NativeDeviceChannel;
import jnr.enxio.channels.NativeSelectableChannel;
import jnr.enxio.channels.NativeSocketChannel;
import jnr.posix.FileStat;
import jnr.posix.POSIX;
@@ -99,12 +100,8 @@ public static boolean isFake(int fileno) {
}

public static int filenoFrom(Channel channel) {
if (channel instanceof NativeDeviceChannel) {
return ((NativeDeviceChannel)channel).getFD();
}

if (channel instanceof NativeSocketChannel) {
return ((NativeSocketChannel)channel).getFD();
if (channel instanceof NativeSelectableChannel) {
return ((NativeSelectableChannel)channel).getFD();
}

return getFilenoUsingReflection(channel);

0 comments on commit 12bb2fa

Please sign in to comment.