Use provided event context rather than looking for it.
[sfrench/samba-autobuild/.git] / source4 / torture / raw / lockbench.c
index 86030c538abc3aff66ff4852d8bda88c4b45248e..d7738be833413d573464915f8120f54214c249ee 100644 (file)
@@ -316,7 +316,6 @@ bool torture_bench_lock(struct torture_context *torture)
        int i;
        int timelimit = torture_setting_int(torture, "timelimit", 10);
        struct timeval tv;
-       struct event_context *ev = event_context_find(mem_ctx);
        struct benchlock_state *state;
        int total = 0, minops=0;
        struct smbcli_state *cli;
@@ -333,8 +332,8 @@ bool torture_bench_lock(struct torture_context *torture)
                state[i].tctx = torture;
                state[i].mem_ctx = talloc_new(state);
                state[i].client_num = i;
-               state[i].ev = ev;
-               if (!torture_open_connection_ev(&cli, i, torture, ev)) {
+               state[i].ev = torture->ev;
+               if (!torture_open_connection_ev(&cli, i, torture, torture->ev)) {
                        return false;
                }
                talloc_steal(mem_ctx, state);
@@ -380,7 +379,7 @@ bool torture_bench_lock(struct torture_context *torture)
 
        printf("Running for %d seconds\n", timelimit);
        while (timeval_elapsed(&tv) < timelimit) {
-               event_loop_once(ev);
+               event_loop_once(torture->ev);
 
                if (lock_failed) {
                        DEBUG(0,("locking failed\n"));