Skip to content

Commit

Permalink
Handle return value 24 the same as 23
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Feb 4, 2024
1 parent 85dc3d0 commit ae06cab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,10 @@ private IStatus launch(Setup setup) {
IStatus outcome = Status.OK_STATUS;
try {
int returnCode = setup.run();
if (returnCode == 23) {
if (returnCode == 23 || returnCode == 24) {
// asked to restart; for now just do this once.
// Note that 23 is our magic return code indicating that a restart is required.
// Note that 23 and 24 are our magic return code indicating that a restart is
// required.
// This can happen for tests that update framework extensions which requires a restart.
returnCode = setup.run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public class Eclipse extends Thread {
// Eclipse exit codes
private static final int NEEDS_RESTART = 23;
private static final int NEEDS_RESTART_ALT = 24;
// Launching status
public static final int STATUS_INIT = 0;
public static final int STATUS_STARTED = 1;
Expand Down Expand Up @@ -110,14 +111,15 @@ public void run() {
} catch (InterruptedException e) {
}
if (Options.isDebug()) {
int exitValue = pr.exitValue();
System.out
.println("Eclipse exited with status code " + pr.exitValue()); //$NON-NLS-1$
if (pr.exitValue() == NEEDS_RESTART) {
.println("Eclipse exited with status code " + exitValue); //$NON-NLS-1$
if (exitValue == NEEDS_RESTART || exitValue == NEEDS_RESTART_ALT) {
System.out
.println("Updates are installed, Eclipse will be restarted."); //$NON-NLS-1$
}
}
} while (pr.exitValue() == NEEDS_RESTART);
} while (pr.exitValue() == NEEDS_RESTART | pr.exitValue() == NEEDS_RESTART_ALT);
} catch (Exception exc) {
exception = exc;
status = STATUS_ERROR;
Expand Down

0 comments on commit ae06cab

Please sign in to comment.