Fix killing the test server.

The '%1' argument seems to be non-POSIX and does not work well with
dash. Store the forked PID instead, and use it directly to kill the
server.
This commit is contained in:
Michał Górny 2013-02-11 10:59:36 +01:00
parent d50eaf3c52
commit a3e8540cd0
1 changed files with 3 additions and 2 deletions

View File

@ -39,6 +39,7 @@ esac
# launching the test HTTP server
./minihttptestserver $SERVERARGS -e $EXPECTEDFILE > $HTTPSERVEROUT &
SERVERPID=$!
while [ -z "$PORT" ]; do
sleep 1
PORT=`cat $HTTPSERVEROUT | sed 's/Listening on port \([0-9]*\)/\1/' `
@ -77,8 +78,8 @@ else
fi
# kill the test HTTP server
kill %1
wait %1
kill $SERVERPID
wait $SERVERPID
# remove temporary files (for success cases)
if [ $RET -eq 0 ]; then