summaryrefslogtreecommitdiff
path: root/source3/lib/gencache.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-02-01 14:24:31 -0500
committerSimo Sorce <idra@samba.org>2008-02-01 14:24:31 -0500
commit2fffc9a1b1fe2a1490e867bb38462e50c282d2b3 (patch)
tree428e09c9b35138db8b7ca7161c659a71aa129d29 /source3/lib/gencache.c
parent93a3c5b3f9927973b4ad1496f593ea147052d1e1 (diff)
parentb708005a7106db26d7df689b887b419c9f2ea41c (diff)
downloadsamba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.tar.gz
samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.tar.bz2
samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.zip
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit 7dbfc7bdc65314466a83e8121b35c9bcb24b2631)
Diffstat (limited to 'source3/lib/gencache.c')
-rw-r--r--source3/lib/gencache.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index a50e5d01fa..663385cfe3 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -32,7 +32,6 @@
#define BLOB_TYPE_LEN 9
static TDB_CONTEXT *cache;
-static bool cache_readonly;
/**
* @file gencache.c
@@ -67,7 +66,6 @@ bool gencache_init(void)
if (!cache && (errno == EACCES)) {
cache = tdb_open_log(cache_fname, 0, TDB_DEFAULT, O_RDONLY, 0644);
if (cache) {
- cache_readonly = True;
DEBUG(5, ("gencache_init: Opening cache file %s read-only.\n", cache_fname));
}
}
@@ -95,7 +93,6 @@ bool gencache_shutdown(void)
DEBUG(5, ("Closing cache file\n"));
ret = tdb_close(cache);
cache = NULL;
- cache_readonly = False;
return ret != -1;
}
@@ -123,10 +120,6 @@ bool gencache_set(const char *keystr, const char *value, time_t timeout)
if (!gencache_init()) return False;
- if (cache_readonly) {
- return False;
- }
-
asprintf(&valstr, CACHE_DATA_FMT, (int)timeout, value);
if (!valstr)
return False;
@@ -161,10 +154,6 @@ bool gencache_del(const char *keystr)
if (!gencache_init()) return False;
- if (cache_readonly) {
- return False;
- }
-
DEBUG(10, ("Deleting cache entry (key = %s)\n", keystr));
ret = tdb_delete_bystring(cache, keystr);
@@ -351,10 +340,6 @@ bool gencache_set_data_blob(const char *keystr, DATA_BLOB *blob, time_t timeout)
return False;
}
- if (cache_readonly) {
- return False;
- }
-
asprintf(&valstr, "%12u/%s", (int)timeout, BLOB_TYPE);
if (!valstr) {
return False;