diff mbox

[08/12] qemu-iotests: fix uninitialized variable

Message ID 20170809215510.22802-9-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Aug. 9, 2017, 9:55 p.m. UTC
The function is used in "common" but defined only after the file
is sourced.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/qemu-iotests/check  | 2 --
 tests/qemu-iotests/common | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Markus Armbruster Aug. 10, 2017, 9:17 a.m. UTC | #1
Drive-by comment:

Paolo Bonzini <pbonzini@redhat.com> writes:

> The function is used in "common" but defined only after the file

"This variable"

> is sourced.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff mbox

Patch

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 1ef6d0ac3a..5b9c0c8ade 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -118,8 +118,6 @@  fi
 
 TIMESTAMP_FILE=check.time-$IMGPROTO-$IMGFMT
 
-tmp="${TEST_DIR}"/$$
-
 _wallclock()
 {
     date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }'
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index adf427501e..35e4d0f87b 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -80,6 +80,8 @@  sortme=false
 expunge=true
 have_test_arg=false
 cachemode=false
+
+tmp="${TEST_DIR}"/$$
 rm -f $tmp.list $tmp.tmp $tmp.sed
 
 export IMGFMT=raw