You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2005/05/01 04:58:47 UTC
svn commit: r165450 - in /spamassassin/trunk/lib/Mail/SpamAssassin/Locker:
Flock.pm Win32.pm
Author: quinlan
Date: Sat Apr 30 19:58:46 2005
New Revision: 165450
URL: http://svn.apache.org/viewcvs?rev=165450&view=rev
Log:
remove $$ from logging messages since those are now standard
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Flock.pm
spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Win32.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Flock.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Flock.pm?rev=165450&r1=165449&r2=165450&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Flock.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Flock.pm Sat Apr 30 19:58:46 2005
@@ -58,11 +58,11 @@
if (!$fh->open ("$lock_file", O_RDWR|O_CREAT)) {
umask $umask; # just in case
- die "locker: safe_lock: $$ cannot create lockfile $lock_file: $!\n";
+ die "locker: safe_lock: cannot create lockfile $lock_file: $!\n";
}
umask $umask; # we've created the file, so reset umask
- dbg("locker: safe_lock: $$ created $lock_file");
+ dbg("locker: safe_lock: created $lock_file");
my $unalarmed = 0;
my $oldalarm = 0;
@@ -71,7 +71,7 @@
# sleeps
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
- dbg("locker: safe_lock: $$ trying to get lock on $path with $max_retries timeout");
+ dbg("locker: safe_lock: trying to get lock on $path with $max_retries timeout");
# max_retries is basically seconds! so use it for the timeout
$oldalarm = alarm $max_retries;
@@ -81,7 +81,7 @@
alarm $oldalarm;
$unalarmed = 1; # avoid calling alarm(0) twice
- dbg("locker: safe_lock: $$ link to $lock_file: link ok");
+ dbg("locker: safe_lock: link to $lock_file: link ok");
$is_locked = 1;
# just to be nice: let people know when it was locked
@@ -100,9 +100,9 @@
$unalarmed or alarm $oldalarm; # if we die'd above, need to reset here
if ($err) {
if ($err =~ /alarm/) {
- dbg("locker: safe_lock: $$ timed out after $max_retries seconds");
+ dbg("locker: safe_lock: timed out after $max_retries seconds");
} else {
- die "locker: safe_lock: $$ $err";
+ die "locker: safe_lock: $err";
}
}
@@ -115,7 +115,7 @@
my ($self, $path) = @_;
if (!exists $self->{lock_fhs} || !defined $self->{lock_fhs}->{$path}) {
- dbg("locker: safe_unlock: $$ no lock handle for $path - already unlocked?");
+ dbg("locker: safe_unlock: no lock handle for $path - already unlocked?");
return;
}
@@ -125,7 +125,7 @@
flock ($fh, LOCK_UN);
$fh->close();
- dbg("locker: safe_unlock: $$ unlocked $path.mutex");
+ dbg("locker: safe_unlock: unlocked $path.mutex");
# do NOT unlink! this would open a race, whereby:
#
@@ -151,7 +151,7 @@
return unless $path;
if (!exists $self->{lock_fhs} || !defined $self->{lock_fhs}->{$path}) {
- warn "locker: refresh_lock: $$ no lock handle for $path\n";
+ warn "locker: refresh_lock: no lock handle for $path\n";
return;
}
@@ -159,7 +159,7 @@
$fh->print ("$$\n");
$fh->flush ();
- dbg("locker: refresh_lock: $$ refresh $path.mutex");
+ dbg("locker: refresh_lock: refresh $path.mutex");
}
###########################################################################
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Win32.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Win32.pm?rev=165450&r1=165449&r2=165450&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Win32.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Locker/Win32.pm Sat Apr 30 19:58:46 2005
@@ -55,17 +55,17 @@
my $lock_file = "$path.lock";
if (-e $lock_file && -M $lock_file > (LOCK_MAX_AGE / 86400)) {
- dbg("locker: safe_lock $$ breaking stale lock: $lock_file");
- unlink($lock_file) || warn "locker: safe_lock: $$ unlink of lock file $lock_file failed: $!\n";
+ dbg("locker: safe_lock: breaking stale lock: $lock_file");
+ unlink($lock_file) || warn "locker: safe_lock: unlink of lock file $lock_file failed: $!\n";
}
for (my $retries = 0; $retries < $max_retries; $retries++) {
if ($retries > 0) {
sleep(1);
# TODO: $self->jittery_one_second_sleep();?
}
- dbg("locker: safe_lock: $$ trying to get lock on $path with $retries retries");
+ dbg("locker: safe_lock: trying to get lock on $path with $retries retries");
if (sysopen(LOCKFILE, $lock_file, O_RDWR|O_CREAT|O_EXCL)) {
- dbg("locker: safe_lock: $$ link to $lock_file: sysopen ok");
+ dbg("locker: safe_lock: link to $lock_file: sysopen ok");
close(LOCKFILE);
return 1;
}
@@ -75,8 +75,8 @@
if ((!defined($age) && $retries > $max_retries / 2) ||
(defined($age) && (time - $age > LOCK_MAX_AGE)))
{
- dbg("locker: safe_lock: $$ breaking stale lock: $lock_file");
- unlink ($lock_file) || warn "locker: safe_lock: $$ unlink of lock file $lock_file failed: $!\n";
+ dbg("locker: safe_lock: breaking stale lock: $lock_file");
+ unlink ($lock_file) || warn "locker: safe_lock: unlink of lock file $lock_file failed: $!\n";
}
}
return 0;
@@ -87,8 +87,8 @@
sub safe_unlock {
my ($self, $path) = @_;
- unlink ("$path.lock") || warn "locker: safe_unlock: $$ unlink failed: $path.lock\n";
- dbg("locker: safe_unlock: $$ unlink $path.lock");
+ unlink ("$path.lock") || warn "locker: safe_unlock: unlink failed: $path.lock\n";
+ dbg("locker: safe_unlock: unlink $path.lock");
}
###########################################################################
@@ -102,7 +102,7 @@
# owns it, but this shouldn't, in theory, be an issue.
utime time, time, "$path.lock";
- dbg("locker: refresh_lock: $$ refresh $path.lock");
+ dbg("locker: refresh_lock: refresh $path.lock");
}
###########################################################################