From: Adam C. Emerson Date: Thu, 31 Mar 2016 20:08:08 +0000 (-0400) Subject: rgw: Do not try to encode or decode time_t X-Git-Tag: v10.1.2~44^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8419%2Fhead;p=ceph.git rgw: Do not try to encode or decode time_t 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 --- diff --git a/src/cls/rgw/cls_rgw_ops.h b/src/cls/rgw/cls_rgw_ops.h index e8a7661d090e..7d8ad2d90970 100644 --- a/src/cls/rgw/cls_rgw_ops.h +++ b/src/cls/rgw/cls_rgw_ops.h @@ -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(t)); } if (struct_v >= 3) { ::decode(unmod_since, bl);