mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-09 07:59:52 +00:00
Merge pull request #512 from ggtakec/master
Changed clock_gettime func to s3fs_clock_gettime for homebrew - #468
This commit is contained in:
commit
a00af2385b
@ -56,8 +56,13 @@ using namespace std;
|
|||||||
#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
|
#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_CLOCK_GETTIME
|
#ifdef HAVE_CLOCK_GETTIME
|
||||||
static int clock_gettime(int clk_id, struct timespec* ts)
|
static int s3fs_clock_gettime(int clk_id, struct timespec* ts)
|
||||||
|
{
|
||||||
|
return clock_gettime(clk_id, ts);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static int s3fs_clock_gettime(int clk_id, struct timespec* ts)
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
if(0 != gettimeofday(&now, NULL)){
|
if(0 != gettimeofday(&now, NULL)){
|
||||||
@ -71,7 +76,7 @@ static int clock_gettime(int clk_id, struct timespec* ts)
|
|||||||
|
|
||||||
inline void SetStatCacheTime(struct timespec& ts)
|
inline void SetStatCacheTime(struct timespec& ts)
|
||||||
{
|
{
|
||||||
if(-1 == clock_gettime(CLOCK_MONOTONIC_COARSE, &ts)){
|
if(-1 == s3fs_clock_gettime(CLOCK_MONOTONIC_COARSE, &ts)){
|
||||||
ts.tv_sec = time(NULL);
|
ts.tv_sec = time(NULL);
|
||||||
ts.tv_nsec = 0;
|
ts.tv_nsec = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user