From f27491aa20c8e3b76cf4684de79ae553f9d207f0 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 6 Jan 2012 19:43:47 +0000 Subject: (get_lock_pid) simplify by reusing cat_() --- urpm/lock.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'urpm') 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 = ; - 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 { -- cgit v1.2.1