mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
gencache: True->true, False->false
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
5ef9184964
commit
d547d030e0
@ -63,7 +63,9 @@ static bool gencache_init(void)
|
||||
int open_flags = O_RDWR|O_CREAT;
|
||||
|
||||
/* skip file open if it's already opened */
|
||||
if (cache) return True;
|
||||
if (cache) {
|
||||
return true;
|
||||
}
|
||||
|
||||
cache_fname = cache_path("gencache.tdb");
|
||||
if (cache_fname == NULL) {
|
||||
@ -112,7 +114,7 @@ static bool gencache_init(void)
|
||||
|
||||
if (!cache) {
|
||||
DEBUG(5, ("Attempt to open gencache.tdb has failed.\n"));
|
||||
return False;
|
||||
return false;
|
||||
}
|
||||
|
||||
cache_fname = lock_path("gencache_notrans.tdb");
|
||||
@ -139,7 +141,7 @@ static bool gencache_init(void)
|
||||
}
|
||||
TALLOC_FREE(cache_fname);
|
||||
|
||||
return True;
|
||||
return true;
|
||||
}
|
||||
|
||||
static TDB_DATA last_stabilize_key(void)
|
||||
@ -295,7 +297,9 @@ bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!gencache_init()) return False;
|
||||
if (!gencache_init()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gencache_have_val(keystr, blob, timeout)) {
|
||||
DEBUG(10, ("Did not store value for %s, we already got it\n",
|
||||
@ -305,7 +309,7 @@ bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
|
||||
|
||||
val = talloc_asprintf(talloc_tos(), CACHE_DATA_FMT, (int)timeout);
|
||||
if (val == NULL) {
|
||||
return False;
|
||||
return false;
|
||||
}
|
||||
val = talloc_realloc(NULL, val, char, talloc_array_length(val)-1);
|
||||
if (val == NULL) {
|
||||
@ -383,7 +387,9 @@ bool gencache_del(const char *keystr)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!gencache_init()) return False;
|
||||
if (!gencache_init()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Deleting cache entry (key=[%s])\n", keystr));
|
||||
|
||||
@ -569,7 +575,7 @@ static void gencache_get_data_blob_parser(time_t timeout, DATA_BLOB blob,
|
||||
* timeout
|
||||
*
|
||||
* @retval true when entry is successfuly fetched
|
||||
* @retval False for failure
|
||||
* @retval false for failure
|
||||
**/
|
||||
|
||||
bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
|
||||
@ -604,7 +610,7 @@ bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
|
||||
*timeout = state.timeout;
|
||||
}
|
||||
|
||||
return True;
|
||||
return true;
|
||||
|
||||
fail:
|
||||
if (was_expired != NULL) {
|
||||
@ -793,14 +799,14 @@ static int wipe_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val,
|
||||
* timeout
|
||||
*
|
||||
* @retval true when entry is successfuly fetched
|
||||
* @retval False for failure
|
||||
* @retval false for failure
|
||||
**/
|
||||
|
||||
bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
|
||||
time_t *ptimeout)
|
||||
{
|
||||
DATA_BLOB blob;
|
||||
bool ret = False;
|
||||
bool ret = false;
|
||||
|
||||
ret = gencache_get_data_blob(keystr, mem_ctx, &blob, ptimeout, NULL);
|
||||
if (!ret) {
|
||||
|
Loading…
Reference in New Issue
Block a user