From 2ee6cb5c91eff0132149d8ad8c9055a42374ceb8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 1 Apr 2003 12:04:32 +0000 Subject: (fuzzy_pidofs): handle the empty /proc/XXX/cmdline case (using /proc/XXX/exe to have the name of the prog) (it is now useful for xfs (XFree86)) --- MDK/Common/System.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'MDK/Common') diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm index c22120a..d5f7997 100644 --- a/MDK/Common/System.pm +++ b/MDK/Common/System.pm @@ -379,7 +379,9 @@ sub update_gnomekderc { sub fuzzy_pidofs { my ($regexp) = @_; - grep { /^(\d+)$/ && MDK::Common::File::cat_("/proc/$_/cmdline") =~ /$regexp/ } MDK::Common::File::all('/proc'); + grep { + /^(\d+)$/ && (MDK::Common::File::cat_("/proc/$_/cmdline") || readlink("/proc/$_/exe") || '') =~ /$regexp/; + } MDK::Common::File::all('/proc'); } 1; -- cgit v1.2.1