summaryrefslogtreecommitdiff
path: root/lib/tdb2
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:04:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:04:13 +0930
commit6d0218598c3f3c69b8c2fdf40d3f9611885a51af (patch)
tree690627e38643d4c926cf36239ea50116d7f8f437 /lib/tdb2
parenta15c1cf175d7f29a50d7b2c1acb0f67faab1b06f (diff)
downloadsamba-6d0218598c3f3c69b8c2fdf40d3f9611885a51af.tar.gz
samba-6d0218598c3f3c69b8c2fdf40d3f9611885a51af.tar.bz2
samba-6d0218598c3f3c69b8c2fdf40d3f9611885a51af.zip
tdb2: make tdb1_null static.
It's only used in two files, make it static in one and do it manually in the other. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 8571daf007f03a2888566dbaae8a5849ffba60f3)
Diffstat (limited to 'lib/tdb2')
-rw-r--r--lib/tdb2/tdb1.h2
-rw-r--r--lib/tdb2/tdb1_tdb.c9
-rw-r--r--lib/tdb2/tdb1_traverse.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/tdb2/tdb1.h b/lib/tdb2/tdb1.h
index 6f23b6dd2b..54b6d936d4 100644
--- a/lib/tdb2/tdb1.h
+++ b/lib/tdb2/tdb1.h
@@ -42,6 +42,4 @@ uint64_t tdb1_incompatible_hash(const void *key, size_t len, uint64_t seed, void
/* @} ******************************************************************/
-extern TDB_DATA tdb1_null;
-
#endif /* tdb1.h */
diff --git a/lib/tdb2/tdb1_tdb.c b/lib/tdb2/tdb1_tdb.c
index 2442d34785..99b83ab72d 100644
--- a/lib/tdb2/tdb1_tdb.c
+++ b/lib/tdb2/tdb1_tdb.c
@@ -28,8 +28,6 @@
#include "tdb1_private.h"
#include <assert.h>
-TDB_DATA tdb1_null;
-
/*
non-blocking increment of the tdb sequence number if the tdb has been opened using
the TDB_SEQNUM flag
@@ -191,8 +189,11 @@ static TDB_DATA _tdb1_fetch(struct tdb_context *tdb, TDB_DATA key)
/* find which hash bucket it is in */
hash = tdb_hash(tdb, key.dptr, key.dsize);
- if (!(rec_ptr = tdb1_find_lock_hash(tdb,key,hash,F_RDLCK,&rec)))
- return tdb1_null;
+ if (!(rec_ptr = tdb1_find_lock_hash(tdb,key,hash,F_RDLCK,&rec))) {
+ ret.dptr = NULL;
+ ret.dsize = 0;
+ return ret;
+ }
ret.dptr = tdb1_alloc_read(tdb, rec_ptr + sizeof(rec) + rec.key_len,
rec.data_len);
diff --git a/lib/tdb2/tdb1_traverse.c b/lib/tdb2/tdb1_traverse.c
index 63052854d5..d9d3649fd9 100644
--- a/lib/tdb2/tdb1_traverse.c
+++ b/lib/tdb2/tdb1_traverse.c
@@ -29,6 +29,8 @@
#define TDB1_NEXT_LOCK_ERR ((tdb1_off_t)-1)
+static TDB_DATA tdb1_null;
+
/* Uses traverse lock: 0 = finish, TDB1_NEXT_LOCK_ERR = error,
other = record offset */
static tdb1_off_t tdb1_next_lock(struct tdb_context *tdb, struct tdb1_traverse_lock *tlock,