mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-05 00:52:05 +00:00
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>
This commit is contained in:
parent
5513bce73e
commit
e0dab7f4ef
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user