diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2018-09-05 09:20:57 +0100 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2021-08-26 07:37:51 +0100 |
commit | e0dab7f4ef6f064d5e874edc46b100bd5cf5ddf1 (patch) | |
tree | bc810d9074d11af231f1f5b3d1518a330b83679f | |
parent | 5513bce73eefe8113f730ea223ef9abd1339c850 (diff) |
reds: Use proper maximum constant for time_t
Some systems use 32-bits, other 64-bits.
Some systems use signed integers, other unsigned integers.
Compute maximum constant based on time_t type.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | server/reds.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/reds.cpp b/server/reds.cpp index 1232e3bb..7ed211db 100644 --- a/server/reds.cpp +++ b/server/reds.cpp @@ -21,6 +21,7 @@ #include <climits> #include <cstdint> #include <cstdio> +#include <limits> #include <pthread.h> #include <unistd.h> @@ -3866,7 +3867,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_ticket(SpiceServer *reds, on_activating_ticketing(reds); reds->config->ticketing_enabled = TRUE; if (lifetime == 0) { - reds->config->taTicket.expiration_time = INT_MAX; + reds->config->taTicket.expiration_time = std::numeric_limits<time_t>::max(); } else { time_t now = spice_get_monotonic_time_ns() / NSEC_PER_SEC; reds->config->taTicket.expiration_time = now + lifetime; |