Fixed osx mistype declaration and typo warnings

This commit is contained in:
Takeshi Nakatani 2021-02-12 23:22:42 +00:00 committed by Andrew Gaul
parent 22b0ae9d51
commit 493802a605
2 changed files with 8 additions and 2 deletions

View File

@ -23,7 +23,7 @@
#include <curl/curl.h> #include <curl/curl.h>
struct sse_type_t; class sse_type_t;
//---------------------------------------------- //----------------------------------------------
// Functions // Functions

View File

@ -32,6 +32,12 @@
#define S3FS_CLOCK_MONOTONIC CLOCK_MONOTONIC #define S3FS_CLOCK_MONOTONIC CLOCK_MONOTONIC
#endif #endif
#if defined(__APPLE__)
#define S3FSLOG_TIME_FMT "%s.%03dZ"
#else
#define S3FSLOG_TIME_FMT "%s.%03ldZ"
#endif
//------------------------------------------------------------------- //-------------------------------------------------------------------
// S3fsLog class // S3fsLog class
//------------------------------------------------------------------- //-------------------------------------------------------------------
@ -91,7 +97,7 @@ class S3fsLog
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
} }
strftime(tmp, sizeof(tmp), "%Y-%m-%dT%H:%M:%S", gmtime_r(&now.tv_sec, &res)); strftime(tmp, sizeof(tmp), "%Y-%m-%dT%H:%M:%S", gmtime_r(&now.tv_sec, &res));
snprintf(current_time, sizeof(current_time), "%s.%03ldZ", tmp, (now.tv_usec / 1000)); snprintf(current_time, sizeof(current_time), S3FSLOG_TIME_FMT, tmp, (now.tv_usec / 1000));
return current_time; return current_time;
} }