]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
testsuite: Fix endless loop on /bin/sh without $RANDOM
authorAndreas Metzler <ametzler@bebt.de>
Sun, 23 Jan 2022 12:40:17 +0000 (13:40 +0100)
committerAndreas Metzler <ametzler@bebt.de>
Sun, 23 Jan 2022 12:42:47 +0000 (13:42 +0100)
Closes #1315
Signed-off-by: Andreas Metzler <ametzler@bebt.de>
tests/scripts/common.sh

index 0198bfadcc7c30676974cf1061ef7cc5a4b0ae7b..42064016bb77650834aa8662291eed6a3bc15c8d 100644 (file)
@@ -86,8 +86,8 @@ check_if_port_listening() {
 # Find a port number not currently in use.
 GETPORT='
     rc=0
-    unset myrandom
     while test $rc = 0; do
+        unset myrandom
         if test -n "$RANDOM"; then myrandom=$(($RANDOM + $RANDOM)); fi
         if test -z "$myrandom"; then myrandom=$(date +%N | sed s/^0*//); fi
         if test -z "$myrandom"; then myrandom=0; fi