From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 14/27] cr-ensure-disk-space: Make main loop body into a subroutine Date: Wed, 16 Sep 2015 14:35:17 +0100 Message-ID: <1442410530-9665-15-git-send-email-ian.jackson@eu.citrix.com> References: <1442410530-9665-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZcCsF-0000bn-27 for xen-devel@lists.xenproject.org; Wed, 16 Sep 2015 13:35:47 +0000 In-Reply-To: <1442410530-9665-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 --- cr-ensure-disk-space | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 0314e7a..8c5a708 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -67,7 +67,7 @@ END our @flights; our %latestref; -for (;;) { +sub iteration_continue () { open P, "-|", onloghost "df --block-size=1M -P $logdir" or die $!; $_=

; m/^filesystem/i or die "$_ ?"; @@ -76,7 +76,7 @@ for (;;) { $!=0; $?=0; close P or die "$! $?"; my $space= $1; printf "space: %8d, wanted: %8d ", $space, logcfg('MinSpaceMby'); - last if $space >= logcfg('MinSpaceMby'); + return 0 if $space >= logcfg('MinSpaceMby'); if (!@flights) { %latestref = (); @@ -141,6 +141,13 @@ for (;;) { END printf "done.\n"; + + return 1; +} + +for (;;) { + iteration_continue() + or last; } printf "ok.\n"; -- 1.7.10.4