From: minima Date: Fri, 28 Jul 2000 00:18:57 +0000 (+0000) Subject: fixed watchdbg midnight rollover loop and removed the date part of the X-Git-Tag: R_1_43~22 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d11ddefb5de3e16b44f78fd9db541bccc9587082;p=spider.git fixed watchdbg midnight rollover loop and removed the date part of the date/time translation to leave just the time. --- diff --git a/Changes b/Changes index 3fe40f5d..96457c08 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +28Jul00======================================================================= +1. fixed watchdbg midnight rollover loop and removed the date part of the +date/time translation to leave just the time. 27Jul00======================================================================= 1. made sure that 'en' is the default language on new users. 2. issue error message if shutdown is attempted by a low privileged user. diff --git a/perl/watchdbg b/perl/watchdbg index 745d6983..6da3a586 100755 --- a/perl/watchdbg +++ b/perl/watchdbg @@ -41,8 +41,8 @@ for (;;) { if ($exp) { printit($line) if $line =~ m{(?:$exp)}oi; } else { - printit($line); - } + printit($line); + } } else { sleep(1); @@ -52,6 +52,7 @@ for (;;) { if ($today[1] != $now[1]) { $fp->close; $fh = $fp->open(@now) or die $!; + @today = @now; } } } @@ -61,6 +62,9 @@ sub printit my $line = shift; my @line = split '\^', $line; my $t = shift @line; - print atime($t), ' ', join('^', @line); + my ($sec,$min,$hour) = gmtime((defined $t) ? $t : time); + my $buf = sprintf "%02d:%02d:%02d", $hour, $min, $sec; + + print $buf, ' ', join('^', @line); } exit(0);