From: Peter J. Farley III Date: Sun, 5 Nov 2000 11:55:59 +0000 (-0500) Subject: [Corrected/tested PATCH] Re: [ID 20001102.008] Not OK: perl v5.7.0 +DEVEL7503 on... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b31946bedf89413584e457a8054ef8e0842e835;p=p5sagit%2Fp5-mst-13.2.git [Corrected/tested PATCH] Re: [ID 20001102.008] Not OK: perl v5.7.0 +DEVEL7503 on i686-linux 2.2.16 Message-Id: <4.3.1.0.20001105115341.00b35160@pop5.banet.net> p4raw-id: //depot/perl@7559 --- diff --git a/t/lib/syslog.t b/t/lib/syslog.t index d73e973..05d8b22 100755 --- a/t/lib/syslog.t +++ b/t/lib/syslog.t @@ -8,6 +8,18 @@ BEGIN { print "1..0 # Skip: Sys::Syslog was not built\n"; exit 0; } + + require Socket; + + # This code inspired by Sys::Syslog::connect(): + require Sys::Hostname; + my ($host_uniq) = Sys::Hostname::hostname(); + my ($host) = $host_uniq =~ /([A-Za-z0-9_.-]+)/; + + if (! defined Socket::inet_aton($host)) { + print "1..0 # Skip: Can't lookup $host\n"; + exit 0; + } } use Sys::Syslog qw(:DEFAULT setlogsock);