Skip to content

Commit

Permalink
bug fix:binlog_sync/pika_binlog/binlog_tool use same time standard:ti…
Browse files Browse the repository at this point in the history
…meval now
  • Loading branch information
wenduo committed Jul 22, 2016
1 parent a1329f9 commit d9369f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/binlog_sync/binlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <unistd.h>

#include <glog/logging.h>
#include <sys/time.h>

#include "slash_mutex.h"

Expand Down Expand Up @@ -244,7 +245,10 @@ Status Binlog::EmitPhysicalRecord(RecordType t, const char *ptr, size_t n, int *

char buf[kHeaderSize];

uint64_t now = slash::NowMicros();
uint64_t now ;
struct timeval tv;
gettimeofday(&tv, NULL);
now = tv.tv_sec;
buf[0] = static_cast<char>(n & 0xff);
buf[1] = static_cast<char>((n & 0xff00) >> 8);
buf[2] = static_cast<char>(n >> 16);
Expand Down

0 comments on commit d9369f2

Please sign in to comment.