r25035: Fix some more warnings, use service pointer rather than service number in...
[samba.git] / source4 / torture / raw / lockbench.c
index 168131a6d291752f6c93bdea36d1a2cbde707a48..55cab9e1178e0fadf0ae8b0a368ffcbb7f650146 100644 (file)
@@ -30,6 +30,7 @@
 #include "lib/cmdline/popt_common.h"
 #include "libcli/composite/composite.h"
 #include "libcli/smb_composite/smb_composite.h"
+#include "param/param.h"
 
 #define BASEDIR "\\benchlock"
 #define FNAME BASEDIR "\\lock.dat"
@@ -251,8 +252,7 @@ static void lock_completion(struct smbcli_request *req)
 
 static void echo_completion(struct smbcli_request *req)
 {
-       struct benchlock_state *state = talloc_get_type(req->async.private, 
-                                                       struct benchlock_state);
+       struct benchlock_state *state = (struct benchlock_state *)req->async.private;
        NTSTATUS status = smbcli_request_simple_recv(req);
        if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) ||
            NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) {
@@ -295,7 +295,7 @@ static void report_rate(struct event_context *ev, struct timed_event *te,
                p.in.size = 0;
                p.in.data = NULL;
                req = smb_raw_echo_send(state[i].tree->session->transport, &p);
-               req->async.private = state;
+               req->async.private = &state[i];
                req->async.fn      = echo_completion;
        }
 }
@@ -318,7 +318,7 @@ BOOL torture_bench_lock(struct torture_context *torture)
 
        progress = torture_setting_bool(torture, "progress", true);
 
-       nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
+       nprocs = lp_parm_int(NULL, "torture", "nprocs", 4);
 
        state = talloc_zero_array(mem_ctx, struct benchlock_state, nprocs);
 
@@ -394,9 +394,10 @@ BOOL torture_bench_lock(struct torture_context *torture)
 
        smbcli_deltree(state[0].tree, BASEDIR);
        talloc_free(mem_ctx);
+       printf("\n");
        return ret;
 
 failed:
        talloc_free(mem_ctx);
-       return False;
+       return false;
 }