Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle return value 24 the same as 23 #1172

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading