From: Kefu Chai Date: Mon, 29 Apr 2019 12:48:30 +0000 (+0800) Subject: include/utime: do not cast sec to time_t X-Git-Tag: v15.1.0~2793^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F27861%2Fhead;p=ceph.git include/utime: do not cast sec to time_t 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 --- diff --git a/src/include/utime.h b/src/include/utime.h index f2f88b55e0c8..019eb7143a72 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -83,8 +83,8 @@ public: #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( - t.time_since_epoch()).count()); + tv.tv_sec = std::chrono::duration_cast( + t.time_since_epoch()).count(); tv.tv_nsec = std::chrono::duration_cast( t.time_since_epoch() % std::chrono::seconds(1)).count(); }