mirror of https://github.com/digint/btrbk
btrbk: add signal handler for SIGINT, dumping transaction log
parent
cea3781ed2
commit
da86557b89
7
btrbk
7
btrbk
|
@ -182,6 +182,13 @@ $SIG{__DIE__} = sub {
|
||||||
Carp::confess @_;
|
Carp::confess @_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$SIG{INT} = sub {
|
||||||
|
print STDERR "\nERROR: Cought SIGINT, dumping transaction log:\n";
|
||||||
|
action("signal", status => "SIGINT");
|
||||||
|
print_formatted("transaction", \@transaction_log, output_format => "tlog", outfile => *STDERR);
|
||||||
|
exit 1;
|
||||||
|
};
|
||||||
|
|
||||||
sub VERSION_MESSAGE
|
sub VERSION_MESSAGE
|
||||||
{
|
{
|
||||||
print STDERR $version_info . "\n\n";
|
print STDERR $version_info . "\n\n";
|
||||||
|
|
Loading…
Reference in New Issue