From: Jacob Bachmeyer Date: Thu, 17 Nov 2022 03:28:36 +0000 (-0600) Subject: Revise ftp_abort and add POD block X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5c024c34a6623646ffef7e0d4a1308c35e8bf862;p=gatekeeper.git Revise ftp_abort and add POD block The second argument is no longer used and is redundant with the $AbortExitCode global variable, so it is removed. --- diff --git a/gatekeeper.pl b/gatekeeper.pl index 22250fa..1f9fdd5 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -433,20 +433,27 @@ sub ftp_syslog { 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