From e9b5215fa01de038f7c273006129043a0466f231 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Wed, 21 Jan 2026 10:35:15 +0530 Subject: [PATCH] printing: Fix compilation error for native 32-bit time_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit#e9a7dce599eb12d broke samba compilation for 32-bit time_t. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15976 Used correct pointer type to fix the warning to fix compialtion. Pair-Programmed-With: Vinit Agnihotri Signed-off-by: Michael Tokarev Signed-off-by: Vinit Agnihotri Reviewed-by: Günther Deschner Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Wed Jan 21 19:23:29 UTC 2026 on atb-devel-224 --- source3/printing/printing.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/printing/printing.c b/source3/printing/printing.c index a9e8422efab..bcfd893456b 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -59,6 +59,7 @@ static int fetch_share_cache_time(const char *key_name, time_t *curr_time) { char *key = NULL; + int64_t curr_time64 = -1; key = talloc_asprintf(NULL, "%s/%s", key_name, sharename); if (key == NULL) { @@ -66,11 +67,12 @@ static int fetch_share_cache_time(const char *key_name, return -1; } - if (tdb_fetch_int64(tdb, key, curr_time) != 0) { + if (tdb_fetch_int64(tdb, key, &curr_time64) != 0) { DBG_ERR("No timing record found for[%s]!\n", sharename); TALLOC_FREE(key); return -1; } + *curr_time = curr_time64; TALLOC_FREE(key); return 0; @@ -82,6 +84,7 @@ static int update_share_cache_time(const char *key_name, time_t curr_time) { char *key = NULL; + int64_t curr_time64 = curr_time; key = talloc_asprintf(NULL, "%s/%s", key_name, sharename); if (key == NULL) { @@ -89,7 +92,7 @@ static int update_share_cache_time(const char *key_name, return -1; } - if (tdb_store_int64(tdb, key, (int64_t)curr_time) != 0) { + if (tdb_store_int64(tdb, key, curr_time64) != 0) { DBG_ERR("Unable to update print cache for %s\n", sharename); TALLOC_FREE(key); return -1; -- 2.43.0