From ffc811b68b2f1296417af38294b5d690657ce039 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 13 Jan 2012 22:33:27 +0100 Subject: [PATCH] functions: make __pids_var_run() dash compliant Signed-off-by: Davide Madrisan --- etc/rc.d/init.d/functions | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/rc.d/init.d/functions b/etc/rc.d/init.d/functions index 24f4b9c..4ffcce6 100755 --- a/etc/rc.d/init.d/functions +++ b/etc/rc.d/init.d/functions @@ -95,9 +95,12 @@ __pids_var_run () pid= if [ -f "$pid_file" ] ; then local line p + [ -r "$pid_file" ] || return 4 # "user had insufficient privilege" read line < "$pid_file" for p in $line ; do - [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p" + case $p in *[!0-9]*) : ;; + *) [ -d "/proc/$p" ] && pid="$pid $p" ;; + esac done if [ -n "$pid" ]; then return 0