]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: Fix compilation error for native 32-bit time_t
authorMichael Tokarev <mjt@tls.msk.ru>
Wed, 21 Jan 2026 05:05:15 +0000 (10:35 +0530)
committerVolker Lendecke <vl@samba.org>
Wed, 21 Jan 2026 19:23:29 +0000 (19:23 +0000)
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 <vagnihot@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 21 19:23:29 UTC 2026 on atb-devel-224

source3/printing/printing.c

index a9e8422efab0e0bc08c7f36a10800d1b371b316e..bcfd893456b23d7969830ab0e10aec6058068478 100644 (file)
@@ -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;