diff options
author | Theo Buehler <botovq@users.noreply.github.com> | 2021-03-17 14:45:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-17 15:45:38 +0200 |
commit | 169be0426c5a4b4eedc04ad94a165c002101e5b2 (patch) | |
tree | 679f4ea857b1707ce4a502e67b14631d022bc3d0 /src/debug.c | |
parent | 6097d14d4d424ee126ef9bdf7269a628e9ca2c92 (diff) | |
download | redis-169be0426c5a4b4eedc04ad94a165c002101e5b2.tar.gz |
Fixes for systems with 64-bit time (#8662)
Some operating systems (e.g., NetBSD and OpenBSD) have switched to
using a 64-bit integer for time_t on all platforms. This results in currently
harmless compiler warnings due to potential truncation.
These changes fix these minor portability concerns.
* Fix format string for systems with 64 bit time
* use llabs to avoid truncation with 64 bit time
Diffstat (limited to 'src/debug.c')
-rw-r--r-- | src/debug.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug.c b/src/debug.c index e7fec293a..2e9d4d1e4 100644 --- a/src/debug.c +++ b/src/debug.c @@ -473,7 +473,7 @@ NULL } else if (!strcasecmp(c->argv[1]->ptr,"segfault")) { *((char*)-1) = 'x'; } else if (!strcasecmp(c->argv[1]->ptr,"panic")) { - serverPanic("DEBUG PANIC called at Unix time %ld", time(NULL)); + serverPanic("DEBUG PANIC called at Unix time %lld", (long long)time(NULL)); } else if (!strcasecmp(c->argv[1]->ptr,"restart") || !strcasecmp(c->argv[1]->ptr,"crash-and-recover")) { |