summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-21 07:30:13 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-22 12:37:30 +0100
commitc44a0ae87aef333570ce588fc9b46392dd528030 (patch)
tree93802beeb06ba4008b306863822d90198d0e3bb3 /source3
parentf029b2b05872f6cfe214241a614081f81c43c7bd (diff)
downloadsamba-c44a0ae87aef333570ce588fc9b46392dd528030.tar.gz
samba-c44a0ae87aef333570ce588fc9b46392dd528030.tar.bz2
samba-c44a0ae87aef333570ce588fc9b46392dd528030.zip
s3:smbcontrol: don't call message_dispatch() anymore, it's triggered by tevent_loop_once()
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/smbcontrol.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index b139ed7400..6ea200bfec 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -65,10 +65,10 @@ static bool send_message(struct messaging_context *msg_ctx,
return ret;
}
-static void smbcontrol_timeout(struct event_context *event_ctx,
- struct timed_event *te,
- struct timeval now,
- void *private_data)
+static void smbcontrol_timeout(struct tevent_context *event_ctx,
+ struct tevent_timer *te,
+ struct timeval now,
+ void *private_data)
{
bool *timed_out = (bool *)private_data;
TALLOC_FREE(te);
@@ -80,21 +80,24 @@ static void smbcontrol_timeout(struct event_context *event_ctx,
static void wait_replies(struct messaging_context *msg_ctx,
bool multiple_replies)
{
- struct timed_event *te;
+ struct tevent_timer *te;
bool timed_out = False;
- if (!(te = event_add_timed(messaging_event_context(msg_ctx), NULL,
- timeval_current_ofs(timeout, 0),
- smbcontrol_timeout, (void *)&timed_out))) {
- DEBUG(0, ("event_add_timed failed\n"));
+ if (!(te = tevent_add_timer(messaging_event_context(msg_ctx), NULL,
+ timeval_current_ofs(timeout, 0),
+ smbcontrol_timeout, (void *)&timed_out))) {
+ DEBUG(0, ("tevent_add_timer failed\n"));
return;
}
while (!timed_out) {
- message_dispatch(msg_ctx);
+ int ret;
if (num_replies > 0 && !multiple_replies)
break;
- event_loop_once(messaging_event_context(msg_ctx));
+ ret = tevent_loop_once(messaging_event_context(msg_ctx));
+ if (ret != 0) {
+ break;
+ }
}
}
@@ -1324,7 +1327,7 @@ int main(int argc, const char **argv)
{
poptContext pc;
int opt;
- struct event_context *evt_ctx;
+ struct tevent_context *evt_ctx;
struct messaging_context *msg_ctx;
static struct poptOption long_options[] = {
@@ -1387,7 +1390,7 @@ int main(int argc, const char **argv)
* routines mostly return True==1 for success, but
* shell needs 0. */
- if (!(evt_ctx = event_context_init(NULL)) ||
+ if (!(evt_ctx = tevent_context_init(NULL)) ||
!(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) {
fprintf(stderr, "could not init messaging context\n");
TALLOC_FREE(frame);