JBAS-980 throttle_disbatcher.pl time printing fix
authorBill Erickson <berickxx@gmail.com>
Wed, 2 Dec 2015 22:40:31 +0000 (17:40 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Code previously displayed "Time::tm=ARRAY(0xe1e4f8)" instead of a time
string.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/linking/throttle_disbatcher.pl

index 12bee51..affa9dc 100755 (executable)
@@ -28,7 +28,7 @@
 
 use Getopt::Long;
 use Time::localtime;
-use POSIX qw/:sys_wait_h/;
+use POSIX qw/:sys_wait_h strftime/;
 
 $SIG{CHLD} = \&sig_handler;
 
@@ -143,8 +143,9 @@ sub dispatch {
     } elsif ($pid) {
         $running++;
         $now_time = localtime;
-        print "$count of $goal processed at " . $now_time . "\n" if ($verbose && $count);
-        print($now_time . ": dispatched: $command\n") if ($verbose);
+        my $now_string = strftime("%a %b %e %H:%M:%S %Y", CORE::localtime);
+        print "$count of $goal processed at $now_string\n" if ($verbose && $count);
+        print($now_string . ": dispatched: $command\n") if ($verbose);
         print $running . " processes running\n" if ($verbose);
     } elsif ($pid == 0) {
         exec($command);