From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 12/27] cr-ensure-disk-space: Honour -D Date: Wed, 16 Sep 2015 14:35:15 +0100 Message-ID: <1442410530-9665-13-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 1ZcCsP-0000o0-V0 for xen-devel@lists.xenproject.org; Wed, 16 Sep 2015 13:35:58 +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 Provide DEBUG and use db_prepare. For now that is the only debugging output. Signed-off-by: Ian Jackson --- cr-ensure-disk-space | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 304f262..ced9777 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -27,11 +27,15 @@ use Fcntl qw(:flock); our $dryrun= 0; +open DEBUG, ">/dev/null" or die $!; + while (@ARGV && $ARGV[0] =~ m/^\-/) { $_= shift @ARGV; last if $_ eq '--'; if (m/^-n$/) { $dryrun= 1; + } elsif (m/^-D$/) { + open DEBUG, ">&2" or die $!; } else { die "$_ ?"; } @@ -50,7 +54,7 @@ flock LOCK, LOCK_EX or die $!; $|=1; -my $chkq= $dbh_tests->prepare("SELECT * FROM flights WHERE flight=?"); +my $chkq= db_prepare("SELECT * FROM flights WHERE flight=?"); our @flights; for (;;) { -- 1.7.10.4