1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

lib:util: Add boolean return type for memcache_add_talloc()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2023-10-26 14:26:57 +02:00 committed by Andreas Schneider
parent 200a5b7617
commit 842d2eca91
2 changed files with 5 additions and 4 deletions

View File

@ -367,7 +367,7 @@ bool memcache_add(struct memcache *cache, enum memcache_number n,
return true;
}
void memcache_add_talloc(struct memcache *cache, enum memcache_number n,
bool memcache_add_talloc(struct memcache *cache, enum memcache_number n,
DATA_BLOB key, void *pptr)
{
struct memcache_talloc_value mtv;
@ -377,12 +377,13 @@ void memcache_add_talloc(struct memcache *cache, enum memcache_number n,
cache = global_cache;
}
if (cache == NULL) {
return;
return false;
}
mtv.len = talloc_total_size(*ptr);
mtv.ptr = talloc_move(cache, ptr);
memcache_add(cache, n, key, data_blob_const(&mtv, sizeof(mtv)));
return memcache_add(cache, n, key, data_blob_const(&mtv, sizeof(mtv)));
}
void memcache_flush(struct memcache *cache, enum memcache_number n)

View File

@ -82,7 +82,7 @@ bool memcache_add(struct memcache *cache, enum memcache_number n,
* talloc objects in the cache types.
*/
void memcache_add_talloc(struct memcache *cache, enum memcache_number n,
bool memcache_add_talloc(struct memcache *cache, enum memcache_number n,
DATA_BLOB key, void *ptr);
/*