From f92fbe8bc00e9e84c4896c464cecf56e7f6a02ad Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 30 Jul 2014 19:44:23 -0700 Subject: [PATCH] Fail if fuser is missing --- proc/linux-lib.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proc/linux-lib.pl b/proc/linux-lib.pl index 72a0d8142..86461da34 100755 --- a/proc/linux-lib.pl +++ b/proc/linux-lib.pl @@ -116,6 +116,7 @@ return undef; sub find_mount_processes { local($out); +&has_command("fuser") || &error("fuser command is not installed"); $out = &backquote_command("fuser -m ".quotemeta($_[0])." 2>/dev/null"); $out =~ s/[^0-9 ]//g; $out =~ s/^\s+//g; $out =~ s/\s+$//g; @@ -127,6 +128,7 @@ return split(/\s+/, $out); sub find_file_processes { local($out, $files); +&has_command("fuser") || &error("fuser command is not installed"); $files = join(' ', map { quotemeta($_) } map { glob($_) } @_); $out = &backquote_command("fuser $files 2>/dev/null"); $out =~ s/[^0-9 ]//g;