]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include: add utime_t ctor for ceph::coarse_real_time 24318/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 2 Oct 2018 19:31:09 +0000 (15:31 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 2 Oct 2018 19:52:35 +0000 (21:52 +0200)
this change differs from the upstream commit 61fb24883e812c11016acea0654f6aef7ddab1f7
because it relied on the std::void_t template, which isn't available in
c++11. just add another explicit constructor for coarse_real_time as a workaround

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/include/utime.h

index 732eaebcdff0c159b218684ba916632f3a7e8fbd..ba4f17e95826fd9ee6da65616151bbb72987c7e1 100644 (file)
@@ -67,6 +67,10 @@ public:
     ceph_timespec ts = real_clock::to_ceph_timespec(rt);
     decode_timeval(&ts);
   }
+  explicit utime_t(const ceph::coarse_real_time& crt) {
+    ceph_timespec ts = coarse_real_clock::to_ceph_timespec(crt);
+    decode_timeval(&ts);
+  }
   utime_t(const struct timeval &v) {
     set_from_timeval(&v);
   }