From: Grazvydas Ignotas Date: Thu, 26 Nov 2015 23:56:59 +0000 (+0200) Subject: pnd_run.sh: improve wait for app exit X-Git-Tag: sz_173~2 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-libraries.git;a=commitdiff_plain;h=7dac5b011cf5f91d05e8e5caae61660c996774ac pnd_run.sh: improve wait for app exit it used to wait for pidof $EXENAME, which is not great as it's often run.sh, meaning that if you have one running, others will never exit. --- diff --git a/testdata/scripts/pnd_run.sh b/testdata/scripts/pnd_run.sh index 2244ef3..0ea23e8 100755 --- a/testdata/scripts/pnd_run.sh +++ b/testdata/scripts/pnd_run.sh @@ -101,13 +101,9 @@ PND_WaitFor() { } PND_WaitForExit() { - local l_sleep=1 - PID=$(pidof -o %PPID -x "$1") # get pid of app - while [ -n "$PID" ]; do - sleep $l_sleep - test $l_sleep -lt 10 && l_sleep=$(($l_sleep + 1)) - PID=$(pidof -o %PPID -x "$1") - done + # this used to wait for $1 ($EXENAME), but that doesn't work well + # when multiple PNDs run as too many PNDs have run.sh as $EXENAME + wait } PND_Exec() {