# HG changeset patch # User Matt Johnston # Date 1406559556 -28800 # Node ID 356a25a108a3338b58f22a6c5b03336a10cd2bbd # Parent ef8d939de3dda8da6f61ffda069bd9e262ea7aa0 Fix some format string warnings diff -r ef8d939de3dd -r 356a25a108a3 dbutil.c --- a/dbutil.c Mon Jul 28 22:48:48 2014 +0800 +++ b/dbutil.c Mon Jul 28 22:59:16 2014 +0800 @@ -161,7 +161,7 @@ gettimeofday(&tv, NULL); va_start(param, format); - fprintf(stderr, "TRACE (%d) %d.%d: ", getpid(), tv.tv_sec, tv.tv_usec); + fprintf(stderr, "TRACE (%d) %d.%d: ", getpid(), (int)tv.tv_sec, (int)tv.tv_usec); vfprintf(stderr, format, param); fprintf(stderr, "\n"); va_end(param); @@ -183,7 +183,7 @@ gettimeofday(&tv, NULL); va_start(param, format); - fprintf(stderr, "TRACE2 (%d) %d.%d: ", getpid(), tv.tv_sec, tv.tv_usec); + fprintf(stderr, "TRACE2 (%d) %d.%d: ", getpid(), (int)tv.tv_sec, (int)tv.tv_usec); vfprintf(stderr, format, param); fprintf(stderr, "\n"); va_end(param); @@ -956,6 +956,7 @@ if (syscall(SYS_clock_gettime, CLOCK_MONOTONIC_COARSE, &ts) == 0) { return CLOCK_MONOTONIC_COARSE; } + if (syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &ts) == 0) { return CLOCK_MONOTONIC; } @@ -968,7 +969,7 @@ static clockid_t clock_source = -2; if (clock_source == -2) { - /* First time, find out which one works. + /* First run, find out which one works. -1 will fall back to time() */ clock_source = get_linux_clock_source(); }