[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 02/10] TestSupport: Introduce next_unique_name



No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 5a4c41f..55541b1 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -46,7 +46,7 @@ BEGIN {
 
                       store_runvar get_runvar get_runvar_maybe
                       get_runvar_default need_runvars flight_otherjob
-                      unique_incrementing_runvar 
+                      unique_incrementing_runvar next_unique_name
 
                       target_cmd_root target_cmd target_cmd_build
                       target_cmd_output_root target_cmd_output
@@ -484,6 +484,11 @@ sub target_file_exists ($$) {
     die "$rfile $out ?";
 }
 
+sub next_unique_name ($) {
+    my ($fnref) = @_;
+    $$fnref .= '+';
+}
+
 our $target_editfile_cancel_exception =
     bless { }, 'Osstest::TestSupport::TargetEditfileCancelException';
 
@@ -509,7 +514,7 @@ sub teditfileex {
             $! == &ENOENT or die "$lfile $!";
             last;
         }
-        $lleaf .= '+';
+        next_unique_name \$lleaf;
     }
     if ($rdest eq $rfile) {
         logm("editing $rfile as $lfile".'{,.new}');
@@ -929,7 +934,7 @@ sub open_unique_stashfile ($) {
         $dh= new IO::File "$stash/$df", O_WRONLY|O_EXCL|O_CREAT;
         last if $dh;
         die "$df $!" unless $!==&EEXIST;
-        $$leafref .= '+';
+        next_unique_name $leafref;
     }
     return $dh;
 }
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.