From a4e4c5b7beec22e4b1a499378db4ca382039fb25 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 17 Aug 2016 15:26:54 +0200 Subject: [PATCH] Fixed warning when testing process state --- dev/ofunctions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 16884f7..7cd00d9 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,6 +1,6 @@ #### MINIMAL-FUNCTION-SET BEGIN #### -## FUNC_BUILD=2016081605 +## FUNC_BUILD=2016081701 ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode @@ -604,7 +604,7 @@ function WaitForTaskCompletion { if kill -0 $pid > /dev/null 2>&1; then # Handle uninterruptible sleep state or zombies by ommiting them from running process array #TODO(high): have this tested on *BSD, Mac & Win - pidState=$(ps -p$pid -o state=) + pidState=$(ps -p$pid -o state= 2 > /dev/null) if [ "$pidState" != "D" ] && [ "$pidState" != "Z" ]; then newPidsArray+=($pid) fi