From: Michael Tokarev Date: Wed, 21 Jan 2026 05:05:15 +0000 (+0530) Subject: printing: Fix compilation error for native 32-bit time_t X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2825363b3accd01e2f5db033c8a0de0e7f532f9;p=thirdparty%2Fsamba.git printing: Fix compilation error for native 32-bit time_t 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 --- 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;