inputoutputstream fd fix
authorbrian <brian@brianweb.net>
Wed, 12 May 2004 04:07:18 +0000 (21:07 -0700)
committerbrian <brian@brianweb.net>
Wed, 12 May 2004 04:07:18 +0000 (21:07 -0700)
darcs-hash:20040512040718-24bed-fca30a23831de2b6049261ced7439137fbcf8439.gz

src/org/ibex/nestedvm/Runtime.java
src/tests/CallTest.java

index c501d0d..50b5162 100644 (file)
@@ -1194,8 +1194,8 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable {
         }
         
         public void _close() {
-            try {is.close(); } catch(IOException e) { /*ignore*/ }
-            try {os.close(); } catch(IOException e) { /*ignore*/ }
+            if(is != null) try { is.close(); } catch(IOException e) { /*ignore*/ }
+            if(os != null) try { os.close(); } catch(IOException e) { /*ignore*/ }
         }
         
         public int read(byte[] a, int off, int length) throws ErrnoException {
index 978eb87..95184ce 100644 (file)
@@ -26,7 +26,7 @@ public class CallTest {
                         case 1: return rt.strdup("OS: " + System.getProperty("os.name"));
                         case 2: return rt.strdup(System.getProperty("os.version"));
                         case 3: return rt.strdup(new Date().toString());
-                        case 4: return rt.addFD(new Runtime.OutputStreamFD(new CustomOS()));
+                        case 4: return rt.addFD(new Runtime.InputOutputStreamFD(null,new CustomOS()));
                         case 5:
                             System.out.println("In callJava() in Java"); 
                             try { rt.call("backinmips"); } catch(Runtime.CallException e) { }