From: Ian Jackson Subject: [OSSTEST PATCH 02/10] TestSupport: Introduce next_unique_name Date: Fri, 6 Feb 2015 19:17:47 +0000 Message-ID: <1423250275-20872-3-git-send-email-ian.jackson@eu.citrix.com> References: <1423250275-20872-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJoPz-0000hV-KE for xen-devel@lists.xenproject.org; Fri, 06 Feb 2015 19:18:19 +0000 In-Reply-To: <1423250275-20872-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org No functional change. Signed-off-by: Ian Jackson --- 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