]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/failtest_helper.c
htable: fix bug where first entry has hash of 0 or 1.
[ccan] / ccan / tdb2 / test / failtest_helper.c
index f094a5974ea26c34a54474875d7c5c04b557ebeb..ab79de1978c5d80291426dfa565b7a544b8cf48b 100644 (file)
@@ -72,7 +72,7 @@ block_repeat_failures(struct tlist_calls *history)
 {
        const struct failtest_call *last;
 
-       last = tlist_tail(history, struct failtest_call, list);
+       last = tlist_tail(history, list);
 
        if (failtest_suppress)
                return FAIL_DONT_FAIL;
@@ -83,6 +83,11 @@ block_repeat_failures(struct tlist_calls *history)
                return FAIL_PROBE;
        }
 
+       /* We handle mmap failing, by falling back to read/write, so
+        * don't try all possible paths. */
+       if (last->type == FAILTEST_MMAP)
+               return FAIL_PROBE;
+
        /* Unlock or non-blocking lock is fail-once. */
        if (is_unlock(last) || is_nonblocking_lock(last))
                return FAIL_PROBE;