From 3de0694a24e8f21e36b5f65586ce032b6afeff13 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 30 May 2007 10:50:06 +0000 Subject: enhance fuzzy_pidofs() to handle kernel processes --- lib/MDK/Common/System.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/MDK/Common/System.pm b/lib/MDK/Common/System.pm index a947523..b856e70 100644 --- a/lib/MDK/Common/System.pm +++ b/lib/MDK/Common/System.pm @@ -471,7 +471,15 @@ sub update_gnomekderc { sub fuzzy_pidofs { my ($regexp) = @_; grep { - /^(\d+)$/ && (MDK::Common::File::cat_("/proc/$_/cmdline") || readlink("/proc/$_/exe") || '') =~ /$regexp/; + if (/^(\d+)$/) { + my $s = MDK::Common::File::cat_("/proc/$_/cmdline") || + readlink("/proc/$_/exe") || + MDK::Common::File::cat_("/proc/$_/stat") =~ /\s(\S+)/ && $1 || + ''; + $s =~ /$regexp/; + } else { + 0; + } } MDK::Common::File::all('/proc'); } -- cgit v1.2.1