diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2013-05-26 14:52:24 +0100 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2013-05-26 14:52:24 +0100 |
commit | 848ca32ce8363c6d7b6f9aecaccb2cdac9abb8e1 (patch) | |
tree | 47b2b920474faff861f9b4100e15470a88c8aa7f /cpan | |
parent | b6990ae0c41eccbe44ff95183c3f5a1f24b50382 (diff) | |
download | perl-848ca32ce8363c6d7b6f9aecaccb2cdac9abb8e1.tar.gz |
Update Sys-Syslog to CPAN version 0.33
[DELTA]
0.33 -- 2013.05.24 -- Sebastien Aperghis-Tramoni (SAPER)
[BUGFIX] CPAN-RT#82531: Invalid usage of POSIX::_exit (Alexander Berger).
[OPTIM] No longer inherit from Exporter.
[OPTIM] Load Fcntl only when necessary.
[DOC] Add links to other logging modules.
[DOC] CPAN-RT#80398: Typo spotted by alfirth@gmail.com
[DOC] Typo spotted by David Steinbrunner.
[TEST] CPAN-RT#79683: Added delays in t/facilities-routing.t
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/Sys-Syslog/Changes | 9 | ||||
-rw-r--r-- | cpan/Sys-Syslog/Syslog.pm | 32 | ||||
-rw-r--r-- | cpan/Sys-Syslog/t/facilities-routing.t | 5 | ||||
-rw-r--r-- | cpan/Sys-Syslog/win32/compile.pl | 8 |
4 files changed, 43 insertions, 11 deletions
diff --git a/cpan/Sys-Syslog/Changes b/cpan/Sys-Syslog/Changes index a30b4908bd..c928430ed3 100644 --- a/cpan/Sys-Syslog/Changes +++ b/cpan/Sys-Syslog/Changes @@ -1,5 +1,14 @@ Revision history for Sys-Syslog +0.33 -- 2013.05.24 -- Sebastien Aperghis-Tramoni (SAPER) + [BUGFIX] CPAN-RT#82531: Invalid usage of POSIX::_exit (Alexander Berger). + [OPTIM] No longer inherit from Exporter. + [OPTIM] Load Fcntl only when necessary. + [DOC] Add links to other logging modules. + [DOC] CPAN-RT#80398: Typo spotted by alfirth@gmail.com + [DOC] Typo spotted by David Steinbrunner. + [TEST] CPAN-RT#79683: Added delays in t/facilities-routing.t + 0.32 -- 2012.09.14 -- Sebastien Aperghis-Tramoni (SAPER) [BUGFIX] CPAN-RT#69040: Don't modify @_ in syslog(). [BUGFIX] Restore compatibility with Perl 5.6.0. diff --git a/cpan/Sys-Syslog/Syslog.pm b/cpan/Sys-Syslog/Syslog.pm index deae4f3d6a..25164af320 100644 --- a/cpan/Sys-Syslog/Syslog.pm +++ b/cpan/Sys-Syslog/Syslog.pm @@ -3,8 +3,7 @@ use strict; use warnings; use warnings::register; use Carp; -use Exporter (); -use Fcntl qw< O_WRONLY >; +use Exporter qw< import >; use File::Basename; use POSIX qw< strftime setlocale LC_TIME >; use Socket qw< :all >; @@ -12,8 +11,7 @@ require 5.005; { no strict 'vars'; - $VERSION = '0.32'; - @ISA = qw< Exporter >; + $VERSION = '0.33'; %EXPORT_TAGS = ( standard => [qw(openlog syslog closelog setlogmask)], @@ -519,11 +517,11 @@ sub _syslog_send_console { } else { if (open(CONS, ">/dev/console")) { my $ret = print CONS $buf . "\r"; # XXX: should this be \x0A ? - POSIX::_exit $ret if defined $pid; + POSIX::_exit($ret) if defined $pid; close CONS; } - POSIX::_exit if defined $pid; + POSIX::_exit(0) if defined $pid; } } @@ -723,15 +721,21 @@ sub connect_stream { # might want syslog_path to be variable based on syslog.h (if only # it were in there!) $syslog_path = '/dev/conslog' unless defined $syslog_path; + if (!-w $syslog_path) { push @$errs, "stream $syslog_path is not writable"; return 0; } - if (!sysopen(SYSLOG, $syslog_path, O_WRONLY, 0400)) { + + require Fcntl; + + if (!sysopen(SYSLOG, $syslog_path, Fcntl::O_WRONLY(), 0400)) { push @$errs, "stream can't open $syslog_path: $!"; return 0; } + $syslog_send = \&_syslog_send_stream; + return 1; } @@ -900,7 +904,7 @@ Sys::Syslog - Perl interface to the UNIX syslog(3) calls =head1 VERSION -This is the documentation of version 0.32 +This is the documentation of version 0.33 =head1 SYNOPSIS @@ -1009,7 +1013,7 @@ process, so this option has no effect on Linux.) =item * C<perror> - Write the message to standard error output as well to the -system log (added in C<Sys::Syslo> 0.22). +system log (added in C<Sys::Syslog> 0.22). =item * @@ -1253,7 +1257,7 @@ Now that the "native" mechanism is supported by C<Sys::Syslog> and selected by default, the use of the C<setlogsock()> function is discouraged because other mechanisms are less portable across operating systems. Authors of modules and programs that use this function, especially its cargo-cult form -C<setlogsock("unix")>, are advised to remove any occurence of it unless they +C<setlogsock("unix")>, are advised to remove any occurrence of it unless they specifically want to use a given mechanism (like TCP or UDP to connect to a remote host). @@ -1557,6 +1561,14 @@ Perl and C<Sys::Syslog> versions. =head1 SEE ALSO +=head2 Other modules + +L<Log::Log4perl> - Perl implementation of the Log4j API + +L<Log::Dispatch> - Dispatches messages to one or more outputs + +L<Log::Report> - Report a problem, with exceptions and language support + =head2 Manual Pages L<syslog(3)> diff --git a/cpan/Sys-Syslog/t/facilities-routing.t b/cpan/Sys-Syslog/t/facilities-routing.t index ce0a5b1b90..54be99f7a4 100644 --- a/cpan/Sys-Syslog/t/facilities-routing.t +++ b/cpan/Sys-Syslog/t/facilities-routing.t @@ -60,12 +60,13 @@ if ($child_pid) { POE::Kernel->run; # check if some messages are missing - my @miss = grep { $received{$_} < 2 } keys %received; + my @miss = sort grep { $received{$_} < 2 } keys %received; diag "@miss" if @miss; } else { # child: send messages to the syslog server sleep 2; + my $delay = .01; setlogsock({ host => $host, type => $proto, port => $port }); # first way, set the facility each time with openlog() @@ -75,6 +76,7 @@ else { for my $level (@levels) { eval { syslog($level => "<$facility\:$level>") } or warn "error: syslog($level => '<$facility\:$level>'): $@"; + select undef, undef, undef, $delay; } } @@ -86,6 +88,7 @@ else { for my $level (@levels) { eval { syslog("$facility.$level" => "<$facility\:$level>") } or warn "error: syslog('$facility.$level' => '<$facility\:$level>'): $@"; + select undef, undef, undef, $delay; } } diff --git a/cpan/Sys-Syslog/win32/compile.pl b/cpan/Sys-Syslog/win32/compile.pl index 3c38691039..3a8cf4fb23 100644 --- a/cpan/Sys-Syslog/win32/compile.pl +++ b/cpan/Sys-Syslog/win32/compile.pl @@ -259,6 +259,14 @@ event log. It is not expected to be directly used by any module other than C<Sys::Syslog> therefore it's API may change at any time and no warranty is made with regards to backward compatibility. You Have Been Warned. +In order to execute this script and compile the Win32 support files, you +need some helper programs: mc.exe, rc.exe and link.exe + +mc.exe and rc.exe can be downloaded from +http://www.microsoft.com/en-us/download/details.aspx?id=11310 + +link.exe is usually shipped with Visual Studio. + =head1 SEE ALSO L<Sys::Syslog> |