summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
authorRobert Spier <rspier@pobox.com>2000-11-28 21:25:39 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-29 15:48:40 +0000
commit7c40f2ffc905b2d7d020da9a2debf52b63f9f0d9 (patch)
treeab6256e8eaef82f5ca9f29c1966bf15980ddf546 /ext/Sys
parent86e48eb5919e74f9dfc880af54f85fde9c591234 (diff)
downloadperl-7c40f2ffc905b2d7d020da9a2debf52b63f9f0d9.tar.gz
Re: Minor suggestion for Sys::Syslog [PATCH]
Message-ID: <14884.44915.86028.422238@localhost.localdomain> More checking in case someone has broken their services or protocol databases. p4raw-id: //depot/perl@7918
Diffstat (limited to 'ext/Sys')
-rw-r--r--ext/Sys/Syslog/Syslog.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index c7ce3ded96..92b82a1acd 100644
--- a/ext/Sys/Syslog/Syslog.pm
+++ b/ext/Sys/Syslog/Syslog.pm
@@ -274,8 +274,8 @@ sub connect {
($host) = $host_uniq =~ /([A-Za-z0-9_.-]+)/; # allow FQDN (inc _)
}
unless ( $sock_type ) {
- my $udp = getprotobyname('udp');
- my $syslog = getservbyname('syslog','udp');
+ my $udp = getprotobyname('udp') || croak "getprotobyname failed for udp";
+ my $syslog = getservbyname('syslog','udp') || croak "getservbyname failed";
my $this = sockaddr_in($syslog, INADDR_ANY);
my $that = sockaddr_in($syslog, inet_aton($host) || croak "Can't lookup $host");
socket(SYSLOG,AF_INET,SOCK_DGRAM,$udp) || croak "socket: $!";