From: Yan, Zheng Date: Fri, 27 May 2016 14:12:29 +0000 (+0800) Subject: rgw: fix compilation on OSX X-Git-Tag: ses5-milestone5~283^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eaec77077be41faef51f2513c6a230a1deb33575;p=ceph.git rgw: fix compilation on OSX On OSX, some fields of struct stat have different names. Signed-off-by: Yan, Zheng --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index e820da375b4..cad2f878d64 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -364,9 +364,15 @@ namespace rgw { st->st_mode = state.unix_mode; +#ifdef HAVE_STAT_ST_MTIMESPEC_TV_NSEC + st->st_atimespec = state.atime; + st->st_mtimespec = state.mtime; + st->st_ctimespec = state.ctime; +#else st->st_atim = state.atime; st->st_mtim = state.mtime; st->st_ctim = state.ctime; +#endif switch (fh.fh_type) { case RGW_FS_TYPE_DIRECTORY: diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 5acba5e0825..e9a58454135 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2,6 +2,7 @@ // vim: ts=8 sw=2 smarttab #include +#include #include #include "common/ceph_crypto.h"