Permalink
Browse files

JRUBY-2109: Rubicon test_io's test_reopen1 fails after IO reorg.

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...
1 parent 5fcc772 commit 7fe5a9649597671c98fc9c598645fcf55ce65243 @vvs vvs committed Feb 13, 2008
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/org/jruby/util/io/ChannelStream.java
@@ -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);

0 comments on commit 7fe5a96

Please sign in to comment.