Skip to content

Commit

Permalink
timeSync: Portable way to print 64bit time_t
Browse files Browse the repository at this point in the history
This ensures when 64bit time_t is used on 32bit architectures (
-D_TIME_BITS=64 ) then it can print it correctly as well.

Fixes
pllLinux.c:43:20: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
|            prefix, tx->offset, tx->freq, tx->maxerror, tx->esterror,
|                    ^~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Jan 3, 2023
1 parent 0ab6ba9 commit 5ff35f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions open-vm-tools/services/plugins/timeSync/pllLinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
static void
TimeSyncLogPLLState(const char *prefix, struct timex *tx)
{
g_debug("%s : off %ld freq %ld maxerr %ld esterr %ld status %d "
"const %ld precision %ld tolerance %ld tick %ld\n",
prefix, tx->offset, tx->freq, tx->maxerror, tx->esterror,
tx->status, tx->constant, tx->precision, tx->tolerance, tx->tick);
g_debug("%s : off %jd freq %jd maxerr %jd esterr %jd status %d "
"const %jd precision %jd tolerance %jd tick %jd\n",
prefix, (intmax_t)tx->offset, (intmax_t)tx->freq, (intmax_t)tx->maxerror, (intmax_t)tx->esterror,
tx->status, (intmax_t)tx->constant, (intmax_t)tx->precision, (intmax_t)tx->tolerance, (intmax_t)tx->tick);
}

/*
Expand Down

0 comments on commit 5ff35f0

Please sign in to comment.