]> git.saurik.com Git - redis.git/commitdiff
Zero-pad timestamps in MONITOR output
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Tue, 14 Dec 2010 16:39:34 +0000 (17:39 +0100)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Tue, 14 Dec 2010 16:39:34 +0000 (17:39 +0100)
Original report and fix:
http://code.google.com/p/redis/issues/detail?id=404

src/replication.c

index a49aa2d8ed48f3871040f98279f9bba6acc90a7a..9f8d9274827f36cca979c1838211adab27ea19f2 100644 (file)
@@ -88,7 +88,7 @@ void replicationFeedMonitors(list *monitors, int dictid, robj **argv, int argc)
     struct timeval tv;
 
     gettimeofday(&tv,NULL);
-    cmdrepr = sdscatprintf(cmdrepr,"%ld.%ld ",(long)tv.tv_sec,(long)tv.tv_usec);
+    cmdrepr = sdscatprintf(cmdrepr,"%ld.%06ld ",(long)tv.tv_sec,(long)tv.tv_usec);
     if (dictid != 0) cmdrepr = sdscatprintf(cmdrepr,"(db %d) ", dictid);
 
     for (j = 0; j < argc; j++) {