diff options
author | Slaven Rezic <slaven@rezic.de> | 2002-05-13 18:02:24 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-16 13:17:42 +0000 |
commit | dbfdd4380d0545596477e869e5553d1636fc53ce (patch) | |
tree | 3f120c64164b0161fb22af7df9ca58be5c991d18 /ext/Sys | |
parent | 9d7debe1023b7931d135e515197539d2f69518ce (diff) | |
download | perl-dbfdd4380d0545596477e869e5553d1636fc53ce.tar.gz |
do not use "udp" on some platforms for Sys::Syslog
Message-Id: <20020513140224.JSLM27460.mailoutvl21@herceg.de>
p4raw-id: //depot/perl@16627
Diffstat (limited to 'ext/Sys')
-rw-r--r-- | ext/Sys/Syslog/Syslog.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index edd813ad8a..a7fd2c93fc 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; |