fixed watchdbg midnight rollover loop and removed the date part of the
authorminima <minima>
Fri, 28 Jul 2000 00:18:57 +0000 (00:18 +0000)
committerminima <minima>
Fri, 28 Jul 2000 00:18:57 +0000 (00:18 +0000)
date/time translation to leave just the time.

Changes
perl/watchdbg

diff --git a/Changes b/Changes
index 3fe40f5d9b56506fd3edd6bcbc9d82f369e17c97..96457c081130f43625db75faaa658aa6e1c57a73 100644 (file)
--- 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.
index 745d6983ebff1598ddf626d4ebdfb5e8249e82d1..6da3a586a712040d19cff2590ab3c5e85b372009 100755 (executable)
@@ -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);