summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/clocks/clocks.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libnetdata/clocks/clocks.c (renamed from libnetdata/clocks/clocks.c)10
1 files changed, 5 insertions, 5 deletions
diff --git a/libnetdata/clocks/clocks.c b/src/libnetdata/clocks/clocks.c
index adbad045f..e1a3e64cb 100644
--- a/libnetdata/clocks/clocks.c
+++ b/src/libnetdata/clocks/clocks.c
@@ -60,7 +60,7 @@ static usec_t get_clock_resolution(clockid_t clock) {
if(clock_getres(clock, &ts) == 0) {
usec_t ret = (usec_t)ts.tv_sec * USEC_PER_SEC + (usec_t)ts.tv_nsec / NSEC_PER_USEC;
- if(!ret && ts.tv_nsec > 0 && ts.tv_nsec < NSEC_PER_USEC)
+ if(!ret && ts.tv_nsec > 0 && ts.tv_nsec < (long int)NSEC_PER_USEC)
return (usec_t)1;
else if(ret > MAX_CLOCK_RESOLUTION_UT) {
@@ -92,7 +92,7 @@ void clocks_init(void) {
inline time_t now_sec(clockid_t clk_id) {
struct timespec ts;
if(unlikely(clock_gettime(clk_id, &ts) == -1)) {
- netdata_log_error("clock_gettime(%d, &timespec) failed.", clk_id);
+ netdata_log_error("clock_gettime(%ld, &timespec) failed.", (long int)clk_id);
return 0;
}
return ts.tv_sec;
@@ -101,7 +101,7 @@ inline time_t now_sec(clockid_t clk_id) {
inline usec_t now_usec(clockid_t clk_id) {
struct timespec ts;
if(unlikely(clock_gettime(clk_id, &ts) == -1)) {
- netdata_log_error("clock_gettime(%d, &timespec) failed.", clk_id);
+ netdata_log_error("clock_gettime(%ld, &timespec) failed.", (long int)clk_id);
return 0;
}
return (usec_t)ts.tv_sec * USEC_PER_SEC + (usec_t)(ts.tv_nsec % NSEC_PER_SEC) / NSEC_PER_USEC;
@@ -111,7 +111,7 @@ inline int now_timeval(clockid_t clk_id, struct timeval *tv) {
struct timespec ts;
if(unlikely(clock_gettime(clk_id, &ts) == -1)) {
- netdata_log_error("clock_gettime(%d, &timespec) failed.", clk_id);
+ netdata_log_error("clock_gettime(%ld, &timespec) failed.", (long int)clk_id);
tv->tv_sec = 0;
tv->tv_usec = 0;
return -1;
@@ -243,7 +243,7 @@ void sleep_to_absolute_time(usec_t usec) {
sleep_usec(usec);
}
}
-};
+}
#endif
#define HEARTBEAT_ALIGNMENT_STATISTICS_SIZE 10