This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#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"
io->in.service_type = state->service_type;
io->in.credentials = cmdline_credentials;
io->in.fallback_to_anonymous = False;
- io->in.workgroup = lp_workgroup();
+ io->in.workgroup = lp_workgroup(global_loadparm);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
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)) {
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;
}
}
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);
smbcli_deltree(state[0].tree, BASEDIR);
talloc_free(mem_ctx);
+ printf("\n");
return ret;
failed:
talloc_free(mem_ctx);
- return False;
+ return false;
}