ShellProcessBuilder now returns exit value of process

This commit is contained in:
nathan 2016-02-20 18:08:23 +01:00
parent 60b12d4036
commit 357895cc79
2 changed files with 11 additions and 5 deletions

View File

@ -200,7 +200,7 @@ class JavaProcessBuilder extends ShellProcessBuilder {
@Override
public
void start() {
int start() {
setExecutable(this.javaLocation);
// save off the original arguments
@ -267,6 +267,6 @@ class JavaProcessBuilder extends ShellProcessBuilder {
this.arguments.addAll(origArguments);
super.start();
return super.start();
}
}

View File

@ -162,7 +162,7 @@ class ShellProcessBuilder {
public
void start() {
int start() {
List<String> argumentsList = new ArrayList<String>();
// if no executable, then use the command shell
@ -403,11 +403,12 @@ class ShellProcessBuilder {
}
}
int exitValue = 0;
try {
this.process.waitFor();
@SuppressWarnings("unused")
int exitValue = this.process.exitValue();
exitValue = this.process.exitValue();
// wait for the READER threads to die (meaning their streams have closed/EOF'd)
if (writeToProcess_input != null) {
@ -434,7 +435,12 @@ class ShellProcessBuilder {
// remove the shutdown hook now that we've shutdown.
Runtime.getRuntime()
.removeShutdownHook(hook);
return exitValue;
}
// 1 means a problem
return 1;
}
/**