fptr = write_io.getOpenFileChecked();
boolean locked = fptr.lock();
try {
if (fptr.socketChannel() != null) {
try {
fptr.socketChannel().shutdownOutput();
} catch (IOException ioe) {
throw runtime.newErrnoFromErrno(Helpers.errnoFromException(ioe), fptr.getPath());
}
fptr.setMode(fptr.getMode() & ~OpenFile.WRITABLE);
if (!fptr.isReadable())