summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-03 17:21:50 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-03 12:33:35 -0600
commit5d0e4f2147d4d1d0104d55756e91ffc13d25c1f3 (patch)
treee7535e932ec6ba77ad667e36bd19eb11fa4986f9
parent4d0514b38abf9c0a9c439cc2b024892d9f7f1f97 (diff)
downloadsamba-5d0e4f2147d4d1d0104d55756e91ffc13d25c1f3.tar.gz
samba-5d0e4f2147d4d1d0104d55756e91ffc13d25c1f3.tar.bz2
samba-5d0e4f2147d4d1d0104d55756e91ffc13d25c1f3.zip
r26650: torture/raw: Fix warnings in lockbench/openbench.
I'm surprised this didn't cause any breakages. We should probably run (a subset of) RAW-LOCKBENCH + RAW-OPENBENCH in make test to make sure they don't regress. (This used to be commit 9bea9c0c4f62dabaaad4c56e7e55da96571b1e1d)
-rw-r--r--source4/torture/raw/lockbench.c11
-rw-r--r--source4/torture/raw/openbench.c10
2 files changed, 15 insertions, 6 deletions
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index 28392880d7..ea570e5bf5 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -59,7 +59,7 @@ struct benchlock_state {
struct timed_event *te;
/* these are used for reconnections */
- int dest_port;
+ const char **dest_ports;
const char *dest_host;
const char *called_name;
const char *service_type;
@@ -186,7 +186,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
}
io->in.dest_host = state->dest_host;
- io->in.dest_ports = state->dest_port;
+ io->in.dest_ports = state->dest_ports;
io->in.called_name = state->called_name;
io->in.service = share;
io->in.service_type = state->service_type;
@@ -345,7 +345,12 @@ bool torture_bench_lock(struct torture_context *torture)
state[i].tree = cli->tree;
state[i].dest_host = talloc_strdup(state[i].mem_ctx,
cli->tree->session->transport->socket->hostname);
- state[i].dest_port = cli->tree->session->transport->socket->port;
+ state[i].dest_ports = talloc_array(state[i].mem_ctx,
+ const char *, 2);
+ state[i].dest_ports[0] = talloc_asprintf(state[i].dest_ports,
+ "%u",
+ cli->tree->session->transport->socket->port);
+ state[i].dest_ports[1] = NULL;
state[i].called_name = talloc_strdup(state[i].mem_ctx,
cli->tree->session->transport->called.name);
state[i].service_type = talloc_strdup(state[i].mem_ctx,
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index 4b6c76488f..0582905816 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -62,7 +62,7 @@ struct benchopen_state {
struct timed_event *te;
/* these are used for reconnections */
- int dest_port;
+ const char **dest_ports;
const char *dest_host;
const char *called_name;
const char *service_type;
@@ -124,7 +124,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
}
io->in.dest_host = state->dest_host;
- io->in.dest_ports = state->dest_port;
+ io->in.dest_ports = state->dest_ports;
io->in.called_name = state->called_name;
io->in.service = share;
io->in.service_type = state->service_type;
@@ -379,7 +379,11 @@ bool torture_bench_open(struct torture_context *torture)
state[i].tree = state[i].cli->tree;
state[i].dest_host = talloc_strdup(state[i].mem_ctx,
state[i].cli->tree->session->transport->socket->hostname);
- state[i].dest_port = state[i].cli->tree->session->transport->socket->port;
+ state[i].dest_ports = talloc_array(state[i].mem_ctx,
+ const char *, 2);
+ state[i].dest_ports[0] = talloc_asprintf(state[i].dest_ports,
+ "%u", state[i].cli->tree->session->transport->socket->port);
+ state[i].dest_ports[1] = NULL;
state[i].called_name = talloc_strdup(state[i].mem_ctx,
state[i].cli->tree->session->transport->called.name);
state[i].service_type = talloc_strdup(state[i].mem_ctx,