From: Slaven Rezic Date: Mon, 13 May 2002 16:02:24 +0000 (+0200) Subject: do not use "udp" on some platforms for Sys::Syslog X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dbfdd4380d0545596477e869e5553d1636fc53ce;p=p5sagit%2Fp5-mst-13.2.git do not use "udp" on some platforms for Sys::Syslog Message-Id: <20020513140224.JSLM27460.mailoutvl21@herceg.de> p4raw-id: //depot/perl@16627 --- diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index edd813a..a7fd2c9 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -13,6 +13,9 @@ $VERSION = '0.03'; # most efficient. However streams are dodgy - see _syslog_send_stream #my @connectMethods = ( 'stream', 'unix', 'tcp', 'udp' ); my @connectMethods = ( 'tcp', 'udp', 'unix', 'stream', 'console' ); +if ($^O =~ /^(freebsd|linux)$/) { + @connectMethods = grep { $_ ne 'udp' } @connectMethods; +} my @defaultMethods = @connectMethods; my $syslog_path = undef; my $transmit_ok = 0; @@ -557,7 +560,7 @@ sub connect_console { # 'protocol' never provides anything for us to read. But with # judicious use of select(), we can see if it would be readable... sub connection_ok { - return 1 if ($current_proto eq 'console'); + return 1 if (defined $current_proto && $current_proto eq 'console'); my $rin = ''; vec($rin, fileno(SYSLOG), 1) = 1; my $ret = select $rin, undef, $rin, 0;