From 7ee30b5692515ac602c88745aaa8c71eb82d376c Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 20 May 2004 19:18:50 -0700 Subject: [PATCH] chdir bug darcs-hash:20040521021850-24bed-d3ab1c5e4a342c641b02d40ce43482ecb9b4159b.gz --- src/org/ibex/nestedvm/UnixRuntime.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/ibex/nestedvm/UnixRuntime.java b/src/org/ibex/nestedvm/UnixRuntime.java index 4c9ed5a..4475795 100644 --- a/src/org/ibex/nestedvm/UnixRuntime.java +++ b/src/org/ibex/nestedvm/UnixRuntime.java @@ -514,10 +514,10 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { private int sys_chdir(int addr) throws ErrnoException, FaultException { String path = normalizePath(cstring(addr)); - //System.err.println("Chdir: " + cstring(addr) + " -> " + path + " pwd: " + cwd); - if(gs.stat(this,path).type() != FStat.S_IFDIR) return -ENOTDIR; + FStat st = gs.stat(this,path); + if(st == null) return -ENOENT; + if(st.type() != FStat.S_IFDIR) return -ENOTDIR; cwd = path; - //System.err.println("Now: [" + cwd + "]"); return 0; } -- 1.7.10.4