+ if ( !length($SigName) ) {
+ my $reason;
+ if ( $sigName eq "INT" ) {
+ $reason = "aborted by user (signal=$sigName)";
+ } else {
+ $reason = "aborted by signal=$sigName";
+ }
+ if ( $Pid == $$ ) {
+ #
+ # Parent logs a message
+ #
+ print(LOG $bpc->timeStamp,
+ "Aborting backup up after signal $sigName\n");
+
+ #
+ # Tell xfer to abort
+ #
+ $xfer->abort($reason);
+
+ #
+ # Send ALRMs to BackupPC_tarExtract if we are using it
+ #
+ if ( $tarPid > 0 ) {
+ kill($bpc->sigName2num("ARLM"), $tarPid);
+ }
+
+ #
+ # Schedule a 20 second timer in case the clean
+ # abort doesn't complete
+ #
+ alarm(20);
+ } else {
+ #
+ # Children ignore anything other than ALRM and INT
+ #
+ if ( $sigName ne "ALRM" && $sigName ne "INT" ) {
+ return;
+ }
+
+ #
+ # The child also tells xfer to abort
+ #
+ $xfer->abort($reason);
+
+ #
+ # Schedule a 15 second timer in case the clean
+ # abort doesn't complete
+ #
+ alarm(15);
+ }
+ $SigName = $sigName;
+ $Abort = 1;
+ return;
+ }
+
+ #
+ # This is a second signal: time to clean up.
+ #
+ if ( $Pid != $$ && ($sigName eq "ALRM" || $sigName eq "INT") ) {
+ #
+ # Children quit quietly on ALRM or INT
+ #
+ exit(1)
+ }