Skip to content

Commit

Permalink
JRUBY-2109: Rubicon test_io's test_reopen1 fails after IO reorg.
Browse files Browse the repository at this point in the history
Regression tests are provided as part of rubyspecs.


git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@5924 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information
vvs committed Feb 13, 2008
1 parent 5fcc772 commit 7fe5a96
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/org/jruby/util/io/ChannelStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,13 @@ public boolean isBlocking() {
public synchronized void freopen(String path, ModeFlags modes) throws DirectoryAsFileException, IOException, InvalidValueException, PipeException, BadDescriptorException {
// flush first
flushWrite();


// reset buffer
buffer.clear();
if (reading) {
buffer.flip();
}

this.modes = modes;
String cwd = getRuntime().getCurrentDirectory();
JRubyFile theFile = JRubyFile.create(cwd,path);
Expand Down

0 comments on commit 7fe5a96

Please sign in to comment.