]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix compilation on OSX
authorYan, Zheng <zyan@redhat.com>
Fri, 27 May 2016 14:12:29 +0000 (22:12 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 18 Jul 2016 07:09:29 +0000 (15:09 +0800)
On OSX, some fields of struct stat have different names.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/rgw/rgw_file.h
src/rgw/rgw_rest_s3.cc

index e820da375b4c456207226dcedb72ff1697fb8ee2..cad2f878d6463959bd726abbb7c538790df71139 100644 (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:
index 5acba5e08255b75cc81bbcdf32b21a42b623f9c3..e9a5845413590747f03ee26cdd5558ed591d7d33 100644 (file)
@@ -2,6 +2,7 @@
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
+#include <array>
 #include <string.h>
 
 #include "common/ceph_crypto.h"