summaryrefslogtreecommitdiff
path: root/lib/Sys
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-03-17 11:21:09 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-03-17 11:21:09 +0000
commit4fc7577ba39ac92e91c6838581448a6ba5ddf896 (patch)
tree7cab4e32a3ab963c740b9834755c1a410611604b /lib/Sys
parentc5f45532ed2b51b2f17fa4a91b637da3665006fc (diff)
downloadperl-4fc7577ba39ac92e91c6838581448a6ba5ddf896.tar.gz
Use Sys::Hostname only when necessary
Diffstat (limited to 'lib/Sys')
-rw-r--r--lib/Sys/Syslog.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm
index 32d2e4ad0d..f02a2b516c 100644
--- a/lib/Sys/Syslog.pm
+++ b/lib/Sys/Syslog.pm
@@ -7,7 +7,6 @@ use Carp;
@EXPORT = qw(openlog closelog setlogmask syslog);
use Socket;
-use Sys::Hostname;
# adapted from syslog.pl
#
@@ -200,6 +199,10 @@ sub xlate {
}
sub connect {
+ unless ($host) {
+ require Sys::Hostname;
+ $host = Sys::Hostname::hostname();
+ }
my $udp = getprotobyname('udp');
my $syslog = getservbyname('syslog','udp');
my $this = sockaddr_in($syslog, INADDR_ANY);