summaryrefslogtreecommitdiff
path: root/ext/Sys/Syslog/Syslog.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Sys/Syslog/Syslog.pm')
-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: $!";