X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2FUnixRuntime.java;h=e3afe98e3ae4e319fe310dfc36937603e3ced802;hp=9b9a8cf2027993e2d9f0922e662a4b1bd0280834;hb=119cb20e2b9d594032653c8464717b1420b6abc7;hpb=cc4469a3b4c4fc1c5070e539f53a3e4cca0b8c75 diff --git a/src/org/ibex/nestedvm/UnixRuntime.java b/src/org/ibex/nestedvm/UnixRuntime.java index 9b9a8cf..e3afe98 100644 --- a/src/org/ibex/nestedvm/UnixRuntime.java +++ b/src/org/ibex/nestedvm/UnixRuntime.java @@ -4,6 +4,8 @@ import org.ibex.nestedvm.util.*; import java.io.*; import java.util.*; +// FEATURE: vfork + public abstract class UnixRuntime extends Runtime implements Cloneable { /** The pid of this "process" */ private int pid; @@ -34,7 +36,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { // FEATURE: Do the proper mangling for non-unix hosts String userdir = getSystemProperty("user.dir"); cwd = - userdir != null && userdir.startsWith("/") && File.separatorChar == '/' && HostFS.hostRootDir().getParent() == null + userdir != null && userdir.startsWith("/") && File.separatorChar == '/' && getSystemProperty("nestedvm.root") == null ? userdir.substring(1) : ""; } @@ -61,7 +63,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { } String[] createEnv(String[] extra) { - String[] defaults = new String[5]; + String[] defaults = new String[6]; int n=0; if(extra == null) extra = new String[0]; if(!envHas("USER",extra) && getSystemProperty("user.name") != null) @@ -71,6 +73,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { if(!envHas("SHELL",extra)) defaults[n++] = "SHELL=/bin/sh"; if(!envHas("TERM",extra)) defaults[n++] = "TERM=vt100"; if(!envHas("TZ",extra)) defaults[n++] = "TZ=" + posixTZ(); + if(!envHas("PATH",extra)) defaults[n++] = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"; String[] env = new String[extra.length+n]; for(int i=0;i