summaryrefslogtreecommitdiff
path: root/vm/reference/java
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2006-09-05 21:33:25 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2006-09-05 21:33:25 +0000
commit81153259e8008b544f38e349cbe462add4de8b01 (patch)
treee8b7bca60700a957724b1bd77e776ad829cf553f /vm/reference/java
parent0d8e0dae89b1375e7001b126d6f4ca8a3f3b22c6 (diff)
downloadclasspath-81153259e8008b544f38e349cbe462add4de8b01.tar.gz
2006-09-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
* native/jni/native-lib/cpprocess.c: (forkAndExec(char*,char*,int,int,pid_t,char*)): Add redirection of stdout to stderr. * native/jni/native-lib/cpprocess.h: Added redirect argument. * native/jni/java-lang/java_lang_VMProcess.c (Java_java_lang_VMProcess_nativeSpawn): Readd redirect argument. * vm/reference/java/lang/VMProcess.java: Likewise. * include/java_lang_VMProcess.h: Regenerated.
Diffstat (limited to 'vm/reference/java')
-rw-r--r--vm/reference/java/lang/VMProcess.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/vm/reference/java/lang/VMProcess.java b/vm/reference/java/lang/VMProcess.java
index 86e4a7b9a..076e5999d 100644
--- a/vm/reference/java/lang/VMProcess.java
+++ b/vm/reference/java/lang/VMProcess.java
@@ -95,6 +95,7 @@ final class VMProcess extends Process
InputStream stdout; // process output stream
InputStream stderr; // process error stream
int exitValue; // process exit value
+ boolean redirect; // redirect stderr -> stdout
//
// Dedicated thread that does all the fork()'ing and wait()'ing
@@ -199,7 +200,8 @@ final class VMProcess extends Process
{
try
{
- process.nativeSpawn(process.cmd, process.env, process.dir);
+ process.nativeSpawn(process.cmd, process.env, process.dir,
+ process.redirect);
process.state = RUNNING;
activeMap.put(new Long(process.pid), process);
}
@@ -218,7 +220,7 @@ final class VMProcess extends Process
}
// Constructor
- private VMProcess(String[] cmd, String[] env, File dir)
+ private VMProcess(String[] cmd, String[] env, File dir, boolean redirect)
throws IOException
{
@@ -227,6 +229,7 @@ final class VMProcess extends Process
this.cmd = cmd;
this.env = env;
this.dir = dir;
+ this.redirect = redirect;
// Add process to the new process work list and wakeup processThread
synchronized (workList)
@@ -301,10 +304,11 @@ final class VMProcess extends Process
*/
static Process exec(String[] cmd, String[] env, File dir) throws IOException
{
- return new VMProcess(cmd, env, dir);
+ return new VMProcess(cmd, env, dir, false);
}
- static Process exec(List cmd, Map env, File dir) throws IOException
+ static Process exec(List cmd, Map env,
+ File dir, boolean redirect) throws IOException
{
String[] acmd = (String[]) cmd.toArray(new String[cmd.size()]);
String[] aenv = new String[env.size()];
@@ -317,7 +321,7 @@ final class VMProcess extends Process
aenv[i++] = entry.getKey() + "=" + entry.getValue();
}
- return new VMProcess(acmd, aenv, dir);
+ return new VMProcess(acmd, aenv, dir, redirect);
}
public OutputStream getOutputStream()
@@ -376,7 +380,8 @@ final class VMProcess extends Process
*
* @throws IOException if the O/S process could not be created.
*/
- native void nativeSpawn(String[] cmd, String[] env, File dir)
+ native void nativeSpawn(String[] cmd, String[] env, File dir,
+ boolean redirect)
throws IOException;
/**