2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00
criu/test/functions.sh
Andrey Vagin f8d6dad7f8 test/app-emu: wait while tasks are dying before starting restore
Otherwise some PID-s may be busy.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-22 19:08:14 +04:00

17 lines
306 B
Bash

# Wait while tasks are dying, otherwise PIDs would be busy.
function wait_tasks()
{
local dump=$1
local pid
for i in $dump/core-*.img; do
pid=`expr "$i" : '.*/core-\([0-9]*\).img'`
while :; do
kill -0 $pid > /dev/null 2>&1 || break;
echo Waiting the process $pid
sleep 0.1
done
done
}