X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2FUnixRuntime.java;h=0bed8ed27ef330538112c773149dacc134fec68d;hp=a6847ee7d918a88f02c183bd9cc074a2c072b054;hb=2db6b04d7557a26e3b9e7440e7968aaec262216f;hpb=47e2513b584db639600b57c79be03093f99b0073 diff --git a/src/org/ibex/nestedvm/UnixRuntime.java b/src/org/ibex/nestedvm/UnixRuntime.java index a6847ee..0bed8ed 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; @@ -33,7 +35,9 @@ 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 == '/' ? userdir.substring(1) : ""; + cwd = + userdir != null && userdir.startsWith("/") && File.separatorChar == '/' && getSystemProperty("nestedvm.root") == null + ? userdir.substring(1) : ""; } // NOTE: getDisplayName() is a Java2 function @@ -59,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) @@ -69,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