cluck($@) if $@;
}
-sub ftp_abort($;$) {
+=item ftp_abort $message
+
+Abandon processing after emitting MESSAGE to the log. Causes the program
+to exit with the current value of the C<$AbortExitCode> global variable.
+
+If the C<$AbortPipe> global variable is defined and an open file, sends
+MESSAGE there; otherwise MESSAGE is sent to syslog with 'err' severity.
+
+=cut
+
+sub ftp_abort($) {
my $msg = shift;
- my $exitcode = shift;
- our $AbortExitCode;
- $exitcode = (defined $exitcode ? $exitcode : $AbortExitCode);
+ our $AbortExitCode; our $AbortPipe;
- our $AbortPipe;
if (defined $AbortPipe && defined fileno $AbortPipe)
{ print $AbortPipe $msg, "\n" }
else
{ ftp_syslog('err', $msg) }
- exit $exitcode;
+ exit $AbortExitCode;
}
# Initialize our syslogging