develooper Front page | perl.perl5.porters | Postings from January 2003

[perl #20557] Bug in Sys::Syslog in perl 5.8.0

From:
Paul Schmidt
Date:
January 27, 2003 07:27
Subject:
[perl #20557] Bug in Sys::Syslog in perl 5.8.0
Message ID:
rt-20557-49726.19.3043442208268@bugs6.perl.org
# New Ticket Created by  Paul Schmidt 
# Please include the string:  [perl #20557]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20557 >



If this is the wrong place for this report I apologize.  Please point me
at the correct destination and I will forward this accordingly.

In the Sys::Syslog::syslog that's bundled with 5.8.0 around line 277
there's a spurious or more likely, a misplaced "&connect unless
$connnected;".  Since it appears before the sub is finished parsing all
it's parameters it breaks the %m/$! functionality by resetting $!.

So it either needs to be moved after the line:

	$message = sprintf($mask, @_);

or

local($errno) = $!;

needs to be added at the beginnning of the function and

	$mask =~ s/%m/$!/g;

needs to be changed to

	$mask =~ s/%m/$errno/g;

Thanx for all the work you all put into making perl the treasure it
is.  Hope this helps.

Cheers,
Paul R. Schmidt
gahan@pschmidt.org





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About