From eb812b2c153b214cdfd54c4a9b9cf4a05d5aed5d Mon Sep 17 00:00:00 2001 From: Jesse Rosenstock Date: Wed, 14 Aug 2002 01:07:59 +0000 Subject: Fix for PR libgcj/7570 and PR libgcj/7578: 2002-08-13 Jesse Rosenstock Fix for PR libgcj/7570 and PR libgcj/7578: * java/lang/natPosixProcess.cc: Include java/io/File.h. (startProcess): Handle new `dir' argument. * java/lang/Win32Process.java (ConcreteProcess): Added `dir' argument. * java/lang/PosixProcess.java (ConcreteProcess): Added `dir' argument. (startProcess): Likewise. * java/lang/EcosProcess.java (ConcreteProcess): Added `dir' argument. * java/lang/Runtime.java (execInternal): Added `dir' argument. (exec): Don't create new environment if ENV==null. Pass DIR to execInternal. * java/lang/natRuntime.cc: Include java/io/File.h. (execInternal): Added `dir' argument. From-SVN: r56268 --- libjava/java/lang/Runtime.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'libjava/java/lang/Runtime.java') diff --git a/libjava/java/lang/Runtime.java b/libjava/java/lang/Runtime.java index eb34391c426..932600b5f8f 100644 --- a/libjava/java/lang/Runtime.java +++ b/libjava/java/lang/Runtime.java @@ -526,7 +526,6 @@ public class Runtime * entries * @throws IndexOutOfBoundsException if cmd is length 0 * @since 1.3 - * @XXX Ignores dir, for now */ public Process exec(String[] cmd, String[] env, File dir) throws IOException @@ -534,10 +533,7 @@ public class Runtime SecurityManager sm = securityManager; // Be thread-safe! if (sm != null) sm.checkExec(cmd[0]); - if (env == null) - env = new String[0]; - //XXX Should be: return execInternal(cmd, env, dir); - return execInternal(cmd, env); + return execInternal(cmd, env, dir); } /** @@ -729,7 +725,6 @@ public class Runtime * the environment should contain name=value mappings. If directory is null, * use the current working directory; otherwise start the process in that * directory. - * XXX Add directory support. * * @param cmd the non-null command tokens * @param env the non-null environment setup @@ -737,8 +732,7 @@ public class Runtime * @return the newly created process * @throws NullPointerException if cmd or env have null elements */ - // native Process execInternal(String[] cmd, String[] env, File dir); - native Process execInternal(String[] cmd, String[] env); + native Process execInternal(String[] cmd, String[] env, File dir); /** * Get the system properties. This is done here, instead of in System, -- cgit v1.2.3