Permalink
Browse files

Fixed [rt.cpan.org #43740] reported by Martin Koehler. Now using

proper POSIX return code EEXISTS instead of error message
depending on English locale.
  • Loading branch information...
1 parent 2891c34 commit 362295d2b05a3648f4fe16ef4309d0168de14662 mschilli committed Mar 7, 2009
Showing with 5 additions and 1 deletion.
  1. +3 −0 Changes
  2. +2 −1 lib/Log/Log4perl/Util/Semaphore.pm
View
@@ -6,6 +6,9 @@
* (ms) Documentation typos fixed, reported by Breno G. de Oliveira
[rt.cpan.org #42428].
* (ms) Fixed DBI appender error message, bug reported by DavidZ.
+ * (ms) Fixed [rt.cpan.org #43740] reported by Martin Koehler. Now using
+ proper POSIX return code EEXISTS instead of error message
+ depending on English locale.
1.20 (2008/12/09)
* (ms) Using semctl to reset the value of the semaphore in the
@@ -4,6 +4,7 @@ package Log::Log4perl::Util::Semaphore;
use IPC::SysV qw(IPC_RMID IPC_CREAT IPC_EXCL SEM_UNDO IPC_NOWAIT
IPC_SET IPC_STAT SETVAL);
use IPC::Semaphore;
+use POSIX qw(EEXIST);
use strict;
use warnings;
use constant INTERNAL_DEBUG => 0;
@@ -57,7 +58,7 @@ sub init {
);
if(! defined $self->{id} and
- $! =~ /exists/) {
+ $! == EEXIST) {
print "Semaphore '$self->{key}' already exists\n" if INTERNAL_DEBUG;
$self->{id} = semget( $self->{ikey}, 1, 0 )
or die "semget($self->{ikey}) failed: $!";

0 comments on commit 362295d

Please sign in to comment.