rgw: fix compilation on OSX

On OSX, some fields of struct stat have different names.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2016-05-27 22:12:29 +08:00
parent 1fb15a210a
commit eaec77077b
2 changed files with 7 additions and 0 deletions

View File

@ -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:

View File

@ -2,6 +2,7 @@
// vim: ts=8 sw=2 smarttab
#include <errno.h>
#include <array>
#include <string.h>
#include "common/ceph_crypto.h"