From 0851d12be96690d0dd97c87958a48562de1f150a Mon Sep 17 00:00:00 2001 From: Rafal Wojtczuk Date: Wed, 30 Mar 2011 10:28:25 +0200 Subject: [PATCH] qvm-copy-to-vm2.kde: prepare for a race in PROGRESS_FILE creation Apparently a tight race may happen when PROGRESS_FILE has been created, but not yet written to by qfile-agent. Check if its content are sane before use. --- appvm/qvm-copy-to-vm2.kde | 1 + 1 file changed, 1 insertion(+) diff --git a/appvm/qvm-copy-to-vm2.kde b/appvm/qvm-copy-to-vm2.kde index de28fee..4c47753 100755 --- a/appvm/qvm-copy-to-vm2.kde +++ b/appvm/qvm-copy-to-vm2.kde @@ -34,6 +34,7 @@ while ! [ -s $PROGRESS_FILE ] ; do done while true ; do read agentpid sentsize agentstatus < $PROGRESS_FILE + if [ "x"$agentstatus = x ] ; then continue ; fi if ! [ -e /proc/$agentpid ] ; then break ; fi if [ "x"$agentstatus = xdone ] ; then break ; fi CURRSIZE=$(($sentsize/1024))