summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-01-16 16:11:42 +0100
committerStefan Metzmacher <metze@samba.org>2012-01-17 08:10:29 +0100
commit77d1053c294f0b25d0c6c03d53acfe7b00f22ef5 (patch)
tree37936a5cd8028fcf842e3e2e5c67550f016d9dec
parente5ee6d3a2473dbfefe649210464c5ef2c050c641 (diff)
downloadsamba-77d1053c294f0b25d0c6c03d53acfe7b00f22ef5.tar.gz
samba-77d1053c294f0b25d0c6c03d53acfe7b00f22ef5.tar.bz2
samba-77d1053c294f0b25d0c6c03d53acfe7b00f22ef5.zip
s3:smbcontrol: pass tevent_context down to wait_replies()
metze
-rw-r--r--source3/utils/smbcontrol.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 7270a89c20..2f5d860526 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -85,13 +85,14 @@ static void smbcontrol_timeout(struct tevent_context *event_ctx,
/* Wait for one or more reply messages */
-static void wait_replies(struct messaging_context *msg_ctx,
+static void wait_replies(struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
bool multiple_replies)
{
struct tevent_timer *te;
bool timed_out = False;
- if (!(te = tevent_add_timer(messaging_event_context(msg_ctx), NULL,
+ if (!(te = tevent_add_timer(ev_ctx, NULL,
timeval_current_ofs(timeout, 0),
smbcontrol_timeout, (void *)&timed_out))) {
DEBUG(0, ("tevent_add_timer failed\n"));
@@ -102,7 +103,7 @@ static void wait_replies(struct messaging_context *msg_ctx,
int ret;
if (num_replies > 0 && !multiple_replies)
break;
- ret = tevent_loop_once(messaging_event_context(msg_ctx));
+ ret = tevent_loop_once(ev_ctx);
if (ret != 0) {
break;
}
@@ -463,7 +464,7 @@ static bool do_ping(struct tevent_context *ev_ctx,
messaging_register(msg_ctx, NULL, MSG_PONG, pong_cb);
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
/* No replies were received within the timeout period */
@@ -580,7 +581,7 @@ static bool do_profilelevel(struct tevent_context *ev_ctx,
messaging_register(msg_ctx, NULL, MSG_REQ_PROFILELEVEL,
profilelevel_rqst);
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
/* No replies were received within the timeout period */
@@ -611,7 +612,7 @@ static bool do_debuglevel(struct tevent_context *ev_ctx,
messaging_register(msg_ctx, NULL, MSG_DEBUGLEVEL, print_pid_string_cb);
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
/* No replies were received within the timeout period */
@@ -857,7 +858,7 @@ static bool do_poolusage(struct tevent_context *ev_ctx,
if (!send_message(msg_ctx, pid, MSG_REQ_POOL_USAGE, NULL, 0))
return False;
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
/* No replies were received within the timeout period */
@@ -1049,7 +1050,7 @@ static bool do_winbind_onlinestatus(struct tevent_context *ev_ctx,
sizeof(myid)))
return False;
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
/* No replies were received within the timeout period */
@@ -1121,7 +1122,7 @@ static bool do_winbind_dump_domain_list(struct tevent_context *ev_ctx,
return false;
}
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
/* No replies were received within the timeout period */
@@ -1170,7 +1171,7 @@ static bool do_winbind_validate_cache(struct tevent_context *ev_ctx,
return False;
}
- wait_replies(msg_ctx, procid_to_pid(&pid) == 0);
+ wait_replies(ev_ctx, msg_ctx, procid_to_pid(&pid) == 0);
if (num_replies == 0) {
printf("No replies received\n");