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) {
if (!cache) {
DEBUG(5, ("Attempt to open gencache.tdb has failed.\n"));
- return False;
+ return false;
}
cache_fname = lock_path("gencache_notrans.tdb");
}
TALLOC_FREE(cache_fname);
- return True;
+ return true;
}
static TDB_DATA last_stabilize_key(void)
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",
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) {
return false;
}
- if (!gencache_init()) return False;
+ if (!gencache_init()) {
+ return false;
+ }
DEBUG(10, ("Deleting cache entry (key=[%s])\n", keystr));
* 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,
*timeout = state.timeout;
}
- return True;
+ return true;
fail:
if (was_expired != NULL) {
* 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) {