Update Sys-Syslog to CPAN version 0.33
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sun, 26 May 2013 13:52:24 +0000 (14:52 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sun, 26 May 2013 13:52:24 +0000 (14:52 +0100)
  [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

Porting/Maintainers.pl
cpan/Sys-Syslog/Changes
cpan/Sys-Syslog/Syslog.pm
cpan/Sys-Syslog/t/facilities-routing.t
cpan/Sys-Syslog/win32/compile.pl

index 367a327..0ad284c 100755 (executable)
@@ -1597,7 +1597,7 @@ use File::Glob qw(:case);
 
     'Sys::Syslog' => {
         'MAINTAINER'   => 'saper',
-        'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.32.tar.gz',
+        'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.33.tar.gz',
         'FILES'        => q[cpan/Sys-Syslog],
         'EXCLUDED'     => [
             qr{^eg/},
index a30b490..c928430 100644 (file)
@@ -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.
index deae4f3..25164af 100644 (file)
@@ -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)>
index ce0a5b1..54be99f 100644 (file)
@@ -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;
         }
     }
 
index 3c38691..3a8cf4f 100644 (file)
@@ -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>