Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise EPIPE for all unseekable channels #7415

Open
wants to merge 1 commit into
base: jruby-9.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 2 additions & 14 deletions core/src/main/java/org/jruby/util/io/PosixShim.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,8 @@ public long lseek(ChannelFD fd, long offset, int type) {
return ret;
}

if (fd.chSelect != null) {
// For other channel types, we can't get at a native descriptor to lseek, and we can't use FileChannel
// .position, so we have to treat them as unseekable and raise EPIPE
//
// TODO: It's perhaps just a coincidence that all the channels for
// which we should raise are instanceof SelectableChannel, since
// stdio is not...so this bothers me slightly. -CON
//
// Original change made in 66b024fedbb2ee32316ccd9de8387931d07993ec
setErrno(Errno.EPIPE);
return -1;
}

return 0;
setErrno(Errno.EPIPE);
return -1;
}

public int write(ChannelFD fd, byte[] bytes, int offset, int length, boolean nonblock) {
Expand Down