summaryrefslogtreecommitdiff
path: root/lib/ntdb/test/failtest_helper.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-19 12:42:08 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-19 05:38:07 +0200
commitd938c0b591d9c4aff9c92ae5eedd26ed97455f42 (patch)
treee3744f9c660fbf23d759493e0391d577e528ffcd /lib/ntdb/test/failtest_helper.c
parent6d5a3e1602a1db8ca8e778f5e4f40bb623dff1e7 (diff)
downloadsamba-d938c0b591d9c4aff9c92ae5eedd26ed97455f42.tar.gz
samba-d938c0b591d9c4aff9c92ae5eedd26ed97455f42.tar.bz2
samba-d938c0b591d9c4aff9c92ae5eedd26ed97455f42.zip
ntdb: allocator attribute.
This is designed to allow us to make ntdb_context (and NTDB_DATA returned from ntdb_fetch) a talloc pointer. But it can also be used for any other alternate allocator. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ntdb/test/failtest_helper.c')
-rw-r--r--lib/ntdb/test/failtest_helper.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/ntdb/test/failtest_helper.c b/lib/ntdb/test/failtest_helper.c
index cc110919c3..45b24512e9 100644
--- a/lib/ntdb/test/failtest_helper.c
+++ b/lib/ntdb/test/failtest_helper.c
@@ -39,6 +39,7 @@ static bool is_unlock(const struct failtest_call *call)
bool exit_check_log(struct tlist_calls *history)
{
const struct failtest_call *i;
+ unsigned int malloc_count = 0;
tlist_for_each(history, i, list) {
if (!i->fail)
@@ -52,8 +53,11 @@ bool exit_check_log(struct tlist_calls *history)
continue;
/* Initial allocation of ntdb doesn't log. */
- if (failmatch(i, INITIAL_NTDB_MALLOC))
- continue;
+ if (i->type == FAILTEST_MALLOC) {
+ if (malloc_count++ == 0) {
+ continue;
+ }
+ }
/* We don't block "failures" on non-blocking locks. */
if (is_nonblocking_lock(i))
@@ -77,8 +81,7 @@ block_repeat_failures(struct tlist_calls *history)
if (failtest_suppress)
return FAIL_DONT_FAIL;
- if (failmatch(last, INITIAL_NTDB_MALLOC)
- || failmatch(last, URANDOM_OPEN)
+ if (failmatch(last, URANDOM_OPEN)
|| failmatch(last, URANDOM_READ)) {
return FAIL_PROBE;
}