diff options
author | Robert Spier <rspier@pobox.com> | 2000-11-28 21:25:39 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-29 15:48:40 +0000 |
commit | 7c40f2ffc905b2d7d020da9a2debf52b63f9f0d9 (patch) | |
tree | ab6256e8eaef82f5ca9f29c1966bf15980ddf546 /ext/Sys | |
parent | 86e48eb5919e74f9dfc880af54f85fde9c591234 (diff) | |
download | perl-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.pm | 4 |
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: $!"; |