]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Do not try to encode or decode time_t 8419/head
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 31 Mar 2016 20:08:08 +0000 (16:08 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 4 Apr 2016 14:56:49 +0000 (10:56 -0400)
time_t's width varies between machines. Also it fails to compile on 32
bit linux.

Fixes: http://tracker.ceph.com/issues/15330
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/cls/rgw/cls_rgw_ops.h

index e8a7661d090e37850bc48d5b864c60edd8116ae1..7d8ad2d90970a1ddf342684b1254bcc0d23b2a5b 100644 (file)
@@ -180,7 +180,7 @@ struct rgw_cls_link_olh_op {
     ::encode(olh_epoch, bl);
     ::encode(log_op, bl);
     ::encode(bilog_flags, bl);
-    time_t t = ceph::real_clock::to_time_t(unmod_since);
+    uint64_t t = ceph::real_clock::to_time_t(unmod_since);
     ::encode(t, bl);
     ::encode(unmod_since, bl);
     ::encode(high_precision_time, bl);
@@ -198,9 +198,9 @@ struct rgw_cls_link_olh_op {
     ::decode(log_op, bl);
     ::decode(bilog_flags, bl);
     if (struct_v == 2) {
-      time_t t;
+      uint64_t t;
       ::decode(t, bl);
-      unmod_since = ceph::real_clock::from_time_t(t);
+      unmod_since = ceph::real_clock::from_time_t(static_cast<time_t>(t));
     }
     if (struct_v >= 3) {
       ::decode(unmod_since, bl);