From df2b00dc3c1d8675cf355c36361f11c0698357f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Fri, 5 Nov 2010 02:48:27 +0100 Subject: [PATCH] jobd: properly display queue sizes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Small Perl gotcha: @foo as a %d arg to printf will not magically be run in scalar context, thus outputting a numeric value for something. Fix by explicitly making it scalar. Signed-off-by: Jan Krüger --- jobd/jobd.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jobd/jobd.pl b/jobd/jobd.pl index 5dd84fc..9400168 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -199,7 +199,7 @@ sub run_queue { $jobs_executed = 0; @jobs_killed = (); unless ($quiet) { - printf STDERR "--- Processing %d queued jobs\n", @queue; + printf STDERR "--- Processing %d queued jobs\n", scalar(@queue); } while (@queue || @running) { reap_hanging_jobs(); @@ -209,7 +209,7 @@ sub run_queue { sleep 10; $queue_steps++; unless (($quiet && !$progress) || ($queue_steps % 10)) { - printf STDERR "STATUS: %d queued, %d running, %d finished, %d killed\n", @queue, @running, $jobs_executed, @jobs_killed; + printf STDERR "STATUS: %d queued, %d running, %d finished, %d killed\n", scalar(@queue), scalar(@running), $jobs_executed, scalar(@jobs_killed); } last; } @@ -217,7 +217,7 @@ sub run_queue { run_job(shift(@queue)) if @queue; } unless ($quiet) { - printf STDERR "--- Queue processed. %d jobs executed, %d killed due to timeouts. Now restarting.\n", @queue, @jobs_killed; + printf STDERR "--- Queue processed. %d jobs executed, %d killed due to timeouts. Now restarting.\n", $jobs_executed, scalar(@jobs_killed); } } -- 2.11.4.GIT