Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed Jul 3, 2023
1 parent 59bce22 commit c22b9af
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions java/src/jmri/managers/DefaultShutDownManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,18 @@ public void handle(Signal sig) {
shutdown();
}
};
if (SystemType.isMacOSX() || SystemType.isLinux()) {
Signal.handle(new Signal("HUP"), handler);
Signal.handle(new Signal("TERM"), handler);
Signal.handle(new Signal("INT"), handler);
}
if (SystemType.isWindows()) {
//Signal.handle(new Signal("BREAK"), handler);
Signal.handle(new Signal("TERM"), handler);
//Signal.handle(new Signal("INT"), handler);
}
try {
if (SystemType.isMacOSX() || SystemType.isLinux()) {
Signal.handle(new Signal("HUP"), handler);
Signal.handle(new Signal("TERM"), handler);
Signal.handle(new Signal("INT"), handler);
}
if (SystemType.isWindows()) {
Signal.handle(new Signal("TERM"), handler);
}
} catch (NullPointerException e) {
log.warn("Failed to add signal handler due to missing signal definition");
}
}

/**
Expand Down

0 comments on commit c22b9af

Please sign in to comment.