summaryrefslogtreecommitdiff
path: root/lib/Sys/Syslog.pm
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-06-18 07:30:13 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-06-18 07:30:13 +0000
commit2eae817dd870472497ae7c14ef66b9d278e970c1 (patch)
tree22804793b46ed4c8772e2e89c93350582d8be41c /lib/Sys/Syslog.pm
parenta31035c61afa529d7cc9672cc1f9c46ddd3aae84 (diff)
downloadperl-2eae817dd870472497ae7c14ef66b9d278e970c1.tar.gz
perl 5.003_01: lib/Sys/Syslog.pm
Correct documentation for calling sequence of syslog() function Move call to hostname() into connect() function, and eliminate domain suffix
Diffstat (limited to 'lib/Sys/Syslog.pm')
-rw-r--r--lib/Sys/Syslog.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm
index f02a2b516c..9df3161a63 100644
--- a/lib/Sys/Syslog.pm
+++ b/lib/Sys/Syslog.pm
@@ -23,7 +23,7 @@ Sys::Syslog, openlog, closelog, setlogmask, syslog - Perl interface to the UNIX
use Sys::Syslog;
openlog $ident, $logopt, $facility;
- syslog $priority, $mask, $format, @args;
+ syslog $priority, $format, @args;
$oldmask = setlogmask $mask_priority;
closelog;
@@ -43,9 +43,9 @@ I<$ident> is prepended to every message.
I<$logopt> contains one or more of the words I<pid>, I<ndelay>, I<cons>, I<nowait>.
I<$facility> specifies the part of the system
-=item syslog $priority, $mask, $format, @args
+=item syslog $priority, $format, @args
-If I<$priority> and I<$mask> permit, logs I<($format, @args)>
+If I<$priority> permits, logs I<($format, @args)>
printed as by C<printf(3V)>, with the addition that I<%m>
is replaced with C<"$!"> (the latest error message).
@@ -89,8 +89,6 @@ Tom Christiansen E<lt>F<tchrist@perl.com>E<gt> and Larry Wall E<lt>F<lwall@sems.
=cut
-$host = hostname() unless $host; # set $Syslog::host to change
-
require 'syslog.ph';
$maskpri = &LOG_UPTO(&LOG_DEBUG);
@@ -201,7 +199,8 @@ sub xlate {
sub connect {
unless ($host) {
require Sys::Hostname;
- $host = Sys::Hostname::hostname();
+ my($host_uniq) = Sys::Hostname::hostname();
+ ($host) = $host_uniq =~ /(\w+)/;
}
my $udp = getprotobyname('udp');
my $syslog = getservbyname('syslog','udp');