Skip to content

Commit

Permalink
include/utime: do not cast sec to time_t
Browse files Browse the repository at this point in the history
strictly speaking, time_t is an opaque time, and in this context, we
need a uint32_t, so it is not necessary and wrong. let's remove it.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Apr 29, 2019
1 parent f2bafe4 commit 50226ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/include/utime.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class utime_t {

#if defined(WITH_SEASTAR)
explicit utime_t(const seastar::lowres_system_clock::time_point& t) {
tv.tv_sec = std::time_t(std::chrono::duration_cast<std::chrono::seconds>(
t.time_since_epoch()).count());
tv.tv_sec = std::chrono::duration_cast<std::chrono::seconds>(
t.time_since_epoch()).count();
tv.tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(
t.time_since_epoch() % std::chrono::seconds(1)).count();
}
Expand Down

0 comments on commit 50226ef

Please sign in to comment.