From d547d030e0e3a9fb250f9d185f6a304064ab716b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 13 Dec 2015 15:17:27 +0100 Subject: [PATCH] gencache: True->true, False->false Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/lib/gencache.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index 90eafaa7be2..ed78476a6e5 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -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) { -- 2.34.1