Skip to content

Commit

Permalink
fix travis error with init time in mockenv
Browse files Browse the repository at this point in the history
Summary:
/home/travis/build/facebook/rocksdb/env/mock_env.cc: In member function ‘virtual void rocksdb::{anonymous}::TestMemLogger::Logv(const char*, va_list)’:
/home/travis/build/facebook/rocksdb/env/mock_env.cc:391:53: error: ‘t.tm::tm_year’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
                     static_cast<int>(now_tv.tv_usec));
Closes facebook#2418

Differential Revision: D5193597

Pulled By: maysamyabandeh

fbshipit-source-id: 8801a3ef27f33eb419d534f7de747702cdf504a0
  • Loading branch information
Maysam Yabandeh authored and facebook-github-bot committed Jun 8, 2017
1 parent 550a1df commit d4f7731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion env/mock_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ class TestMemLogger : public Logger {
gettimeofday(&now_tv, nullptr);
const time_t seconds = now_tv.tv_sec;
struct tm t;
localtime_r(&seconds, &t);
auto ret __attribute__((__unused__)) = localtime_r(&seconds, &t);
assert(ret);
p += snprintf(p, limit - p,
"%04d/%02d/%02d-%02d:%02d:%02d.%06d ",
t.tm_year + 1900,
Expand Down

0 comments on commit d4f7731

Please sign in to comment.