diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-19 17:36:54 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-27 19:34:51 +0200 |
commit | 3bd78eb2faf09635b8d307e4440ccb1420f80716 (patch) | |
tree | c6a5c38c6ad0edf82b81949772e7a14723cf89df /src/providers/dp_dyndns.c | |
parent | bfdb2eeed95bde6cd065a9a47a7cb1773990ccfb (diff) | |
download | sssd-3bd78eb2faf09635b8d307e4440ccb1420f80716.tar.gz sssd-3bd78eb2faf09635b8d307e4440ccb1420f80716.tar.xz sssd-3bd78eb2faf09635b8d307e4440ccb1420f80716.zip |
Fix dyndns timer initialization
The dyndns init function was starting the timer even if the updates were
set to False. This patch splits the init of dynamic updates and the
timer into two functions so that the back end can start the updates
separately from reading the options.
Diffstat (limited to 'src/providers/dp_dyndns.c')
-rw-r--r-- | src/providers/dp_dyndns.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c index 8cf42443..1b710b55 100644 --- a/src/providers/dp_dyndns.c +++ b/src/providers/dp_dyndns.c @@ -1181,8 +1181,6 @@ static struct dp_option default_dyndns_opts[] = { errno_t be_nsupdate_init(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx, struct dp_option *defopts, - nsupdate_timer_fn_t timer_callback, - void *timer_pvt, struct be_nsupdate_ctx **_ctx) { errno_t ret; @@ -1212,10 +1210,20 @@ be_nsupdate_init(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx, return EINVAL; } + *_ctx = ctx; + return ERR_OK; +} + +errno_t be_nsupdate_init_timer(struct be_nsupdate_ctx *ctx, + struct tevent_context *ev, + nsupdate_timer_fn_t timer_callback, + void *timer_pvt) +{ + if (ctx == NULL) return EINVAL; + ctx->timer_callback = timer_callback; ctx->timer_pvt = timer_pvt; - be_nsupdate_timer_schedule(be_ctx->ev, ctx); + be_nsupdate_timer_schedule(ev, ctx); - *_ctx = ctx; return ERR_OK; } |