mirror of
https://github.com/deajan/obackup.git
synced 2026-02-06 07:05:14 +01:00
Fixed warning when testing process state
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#### MINIMAL-FUNCTION-SET BEGIN ####
|
#### 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
|
## 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
|
## 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
|
if kill -0 $pid > /dev/null 2>&1; then
|
||||||
# Handle uninterruptible sleep state or zombies by ommiting them from running process array
|
# Handle uninterruptible sleep state or zombies by ommiting them from running process array
|
||||||
#TODO(high): have this tested on *BSD, Mac & Win
|
#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
|
if [ "$pidState" != "D" ] && [ "$pidState" != "Z" ]; then
|
||||||
newPidsArray+=($pid)
|
newPidsArray+=($pid)
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user