diff --git a/README.md b/README.md index 190cdf3..dd0e263 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Many systems provide pre-built packages: sudo zypper install s3fs ``` -* macOS via [Homebrew](https://brew.sh/): +* macOS 10.12 and newer via [Homebrew](https://brew.sh/): ``` brew install --cask osxfuse diff --git a/src/cache.cpp b/src/cache.cpp index 14eda11..13df00c 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -18,11 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include #include #include -#ifndef HAVE_CLOCK_GETTIME -#include -#endif #include @@ -45,29 +43,11 @@ #define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC #endif -#ifdef HAVE_CLOCK_GETTIME -static int s3fs_clock_gettime(int clk_id, struct timespec* ts) -{ - return clock_gettime(static_cast(clk_id), ts); -} -#else -static int s3fs_clock_gettime(int clk_id, struct timespec* ts) -{ - struct timeval now; - if(0 != gettimeofday(&now, NULL)){ - return -1; - } - ts->tv_sec = now.tv_sec; - ts->tv_nsec = now.tv_usec * 1000; - return 0; -} -#endif - inline void SetStatCacheTime(struct timespec& ts) { - if(-1 == s3fs_clock_gettime(CLOCK_MONOTONIC_COARSE, &ts)){ - ts.tv_sec = time(NULL); - ts.tv_nsec = 0; + if(-1 == clock_gettime(static_cast(CLOCK_MONOTONIC_COARSE), &ts)){ + S3FS_PRN_CRIT("clock_gettime failed: %d", errno); + abort(); } }