ctdb-recoverd: CID 1509028 - Use of 32-bit time_t (Y2K38_SAFETY)
authorMartin Schwenke <mschwenke@ddn.com>
Tue, 11 Oct 2022 22:05:25 +0000 (09:05 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 19 Jul 2023 09:01:33 +0000 (09:01 +0000)
usecs is going to be passed as a uint32_t.  There is no need to
calculate it as a time_t.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 893af8f1f4f8709b43ffdf6a026513fdfc1b9015..040cbffe95395dd67d29722b9211ef2b16a541e5 100644 (file)
@@ -619,7 +619,7 @@ static void ctdb_wait_handler(struct tevent_context *ev,
 static void ctdb_wait_timeout(struct ctdb_context *ctdb, double secs)
 {
        uint32_t timed_out = 0;
-       time_t usecs = (secs - (time_t)secs) * 1000000;
+       uint32_t usecs = (secs - (uint32_t)secs) * 1000000;
        tevent_add_timer(ctdb->ev, ctdb, timeval_current_ofs(secs, usecs),
                         ctdb_wait_handler, &timed_out);
        while (!timed_out) {