]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: do not try to encode or decode time_t
authorKefu Chai <kchai@redhat.com>
Wed, 17 Aug 2016 04:12:37 +0000 (12:12 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Aug 2016 04:15:08 +0000 (12:15 +0800)
time_t is `signed int` on linux, which is ambiguous when encode() or decode() on i386-linux.
see also 8f9e7b0b.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/cls/rgw/cls_rgw_types.h

index 7527db7c7276deee4d67e773d256a9027e238022..17697d292b704af4521da0f6059f31faf133a620 100644 (file)
@@ -939,14 +939,17 @@ struct cls_rgw_lc_obj_head
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(start_date, bl);
+    uint64_t t = start_date;
+    ::encode(t, bl);
     ::encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(start_date, bl);
+    uint64_t t;
+    ::decode(t, bl);
+    start_date = static_cast<time_t>(t);
     ::decode(marker, bl);
     DECODE_FINISH(bl);
   }