modules/core/util/src/main/java/org/rhq/core/util/exec/ProcessExecutor.java | 10
++++------
1 file changed, 4 insertions(+), 6 deletions(-)
New commits:
commit a6341a855844845c523c09c343a74f31b542b97c
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu May 30 22:05:52 2013 -0400
revert changes to ProcessExecutor.startProgram since they break api compatibility
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/exec/ProcessExecutor.java
b/modules/core/util/src/main/java/org/rhq/core/util/exec/ProcessExecutor.java
index eb64ecb..e74bcce 100644
--- a/modules/core/util/src/main/java/org/rhq/core/util/exec/ProcessExecutor.java
+++ b/modules/core/util/src/main/java/org/rhq/core/util/exec/ProcessExecutor.java
@@ -68,8 +68,8 @@ public class ProcessExecutor {
ProcessExecutorResults results = new ProcessExecutorResults();
try {
- startProgram(processToStart, results);
-
+ Integer exitCode = startProgram(processToStart);
+ results.setExitCode(exitCode);
} catch (Throwable t) {
results.setError(t);
}
@@ -89,7 +89,7 @@ public class ProcessExecutor {
* start the process but not wait or was to wait and the wait time expired
before the process exited
* @throws Exception if any error occurs while trying to start the child process
*/
- protected void startProgram(final ProcessToStart process, ProcessExecutorResults
results) throws Exception {
+ protected Integer startProgram(final ProcessToStart process) throws Exception {
// prepare the process comand line and environment
String[] cmdline = getCommandLine(process);
File workingDir = getWorkingDirectory(process);
@@ -97,7 +97,6 @@ public class ProcessExecutor {
// execute the program
final Process childProcess = Runtime.getRuntime().exec(cmdline, environment,
workingDir);
- results.setProcess(childProcess);
// redirect the program's streams
final RedirectThreads redirect = redirectAllStreams(process, childProcess);
@@ -139,8 +138,7 @@ public class ProcessExecutor {
}
}
- results.setExitCode(exitCode);
- ;
+ return exitCode;
}
/**
Show replies by date