Skip to content

Commit

Permalink
install sigpipe signal handler
Browse files Browse the repository at this point in the history
  • Loading branch information
heuermh committed May 31, 2024
1 parent 9b4cb86 commit 449495c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/github/heuermh/cooper/Cooper.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ public static void main(final String[] args) {
}
logger = LoggerFactory.getLogger(Cooper.class);

// install a signal handler to exit on SIGPIPE
sun.misc.Signal.handle(new sun.misc.Signal("PIPE"), new sun.misc.SignalHandler() {
@Override
public void handle(final sun.misc.Signal signal) {
System.exit(0);
}
});

System.exit(new CommandLine(new Cooper()).execute(args));
}
}

0 comments on commit 449495c

Please sign in to comment.