Skip to contentSkip to conversation

master - TEST (lvconvert-raid): localize a function variable

PATCH Jonathan Brassow 1 participant 1 message Jul 3, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7168880caa5f09da254e930313c2d59547643bb2
Commit:        7168880caa5f09da254e930313c2d59547643bb2
Parent:        149ab6921e9029e12899c280f290656b1b60742f
Author:        Jonathan Brassow <[email protected]>
AuthorDate:    Mon Jun 25 22:25:46 2012 -0500
Committer:     Jonathan Brassow <[email protected]>
CommitterDate: Mon Jun 25 22:25:46 2012 -0500

TEST (lvconvert-raid): localize a function variable

Function was overwriting a global variable because it used a variable of the same name without first declaring it with 'local'.

---
 test/shell/lvconvert-raid.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
test/shell/lvconvert-raid.sh +1 -0
index e7df164..6c289a8 100644
@@ -60,6 +60,7 @@ is_in_sync_() {
 
 # wait_for_sync <VG/LV>
 wait_for_sync_() {
+	local i
 	for i in {1..100} ; do
 		is_in_sync_ $1 && return
 		sleep 1