diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-01-06 19:43:47 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-01-06 19:43:47 +0000 |
commit | f27491aa20c8e3b76cf4684de79ae553f9d207f0 (patch) | |
tree | 2f9b50c5e588074c4b14c8c4cae4aefe7ef84fe4 /urpm/lock.pm | |
parent | 1c44e4e5600ee7b981f6b5c8a0181e5323d50dbb (diff) | |
download | urpmi-f27491aa20c8e3b76cf4684de79ae553f9d207f0.tar urpmi-f27491aa20c8e3b76cf4684de79ae553f9d207f0.tar.gz urpmi-f27491aa20c8e3b76cf4684de79ae553f9d207f0.tar.bz2 urpmi-f27491aa20c8e3b76cf4684de79ae553f9d207f0.tar.xz urpmi-f27491aa20c8e3b76cf4684de79ae553f9d207f0.zip |
(get_lock_pid) simplify by reusing cat_()
Diffstat (limited to 'urpm/lock.pm')
-rw-r--r-- | urpm/lock.pm | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/urpm/lock.pm b/urpm/lock.pm index bcc02627..28967137 100644 --- a/urpm/lock.pm +++ b/urpm/lock.pm @@ -56,10 +56,7 @@ sub get_lock_pid { 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 (urpm::util::cat_('/proc/locks')) { /FLOCK.*WRITE\s*(\d+)\s*$fileid\s/ && return $1 } } sub _lock { |