summaryrefslogtreecommitdiffstats
path: root/urpm/lock.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-06 19:43:44 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-06 19:43:44 +0000
commit1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb (patch)
treec5be614f327a245cde0840d50b8fdfacf2d7529c /urpm/lock.pm
parent1fd8be50f3a52993761b92ba90cdecc04825da37 (diff)
downloadurpmi-1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb.tar
urpmi-1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb.tar.gz
urpmi-1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb.tar.bz2
urpmi-1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb.tar.xz
urpmi-1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb.zip
perl_checker cleanups
Diffstat (limited to 'urpm/lock.pm')
-rw-r--r--urpm/lock.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/urpm/lock.pm b/urpm/lock.pm
index fc8cc5f4..bcc02627 100644
--- a/urpm/lock.pm
+++ b/urpm/lock.pm
@@ -52,14 +52,14 @@ sub new {
sub get_lock_pid {
my ($fh) = @_;
- my ($dev,$ino,undef) = stat($fh);
+ my ($dev, $ino, undef) = stat($fh);
my $major = int($dev/256);
my $minor = $dev % 256;
my $fileid = sprintf("%02x:%02x:%d",$major,$minor,$ino);
open(LOCKS, "/proc/locks") || return;
my @locks = <LOCKS>;
close(LOCKS);
- foreach (@locks) { /FLOCK.*WRITE\s*(\d+)\s*$fileid\s/ && return $1 };
+ foreach (@locks) { /FLOCK.*WRITE\s*(\d+)\s*$fileid\s/ && return $1 }
}
sub _lock {
@@ -76,11 +76,11 @@ sub _lock {
flock($lock->{fh}, $mode) or $lock->{fatal}(N("aborting"));
} else {
my $pid = get_lock_pid($lock->{fh});
- if($pid) {
+ if ($pid) {
my $name = urpm::util::cat_("/proc/$pid/cmdline");
$name =~ tr/\0/ /;
$name =~ s/ *$//;
- $lock->{fatal}(N("%s database is locked, process %d is already using it", $lock->{db_name}, $pid).($name?" ($name)":""));
+ $lock->{fatal}(N("%s database is locked, process %d is already using it", $lock->{db_name}, $pid) . ($name ? " ($name)" : ""));
} else {
$lock->{fatal}(N("%s database is locked (another program is already using it)", $lock->{db_name}));
}