1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Do not try to get the exit value if the session is terminated.

This commit is contained in:
Alain Magloire 2002-08-21 16:02:10 +00:00
parent d5fbd8f312
commit d6695357c3

View file

@ -118,15 +118,17 @@ public class MIInferior extends Process {
* @see java.lang.Process#exitValue()
*/
public int exitValue() {
if (isTerminated() && !session.isTerminated()) {
CommandFactory factory = session.getCommandFactory();
MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
try {
session.postCommand(code);
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
return info.getCode();
} catch (MIException e) {
return 0;
if (isTerminated()) {
if (!session.isTerminated()) {
CommandFactory factory = session.getCommandFactory();
MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
try {
session.postCommand(code);
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
return info.getCode();
} catch (MIException e) {
return 0;
}
}
}
throw new IllegalThreadStateException();