1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

eventscript: reduce code duplication for ending a script, and fix bug

Commit 50c2caed57c0 removed a gratuitous talloc_steal from the code in
ctdb_control_event_script_finished(), but not ctdb_event_script_timeout().

Easiest to call ctdb_control_event_script_finished() at the bottom of the
timeout routine.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 17fa252d0d6981fbae8083a818f26d5ce9c5102e)
This commit is contained in:
Rusty Russell 2009-12-02 16:15:57 +10:30
parent 2c80c91c87
commit 774bf144c1

View File

@ -717,12 +717,7 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve
script->timedout = 1;
}
if (ctdb->last_monitor_status_ctx) {
talloc_free(ctdb->last_monitor_status_ctx);
ctdb->last_monitor_status_ctx = NULL;
}
ctdb->last_monitor_status_ctx = talloc_steal(ctdb, ctdb->current_monitor_status_ctx);
ctdb->current_monitor_status_ctx = NULL;
ctdb_control_event_script_finished(ctdb);
}
talloc_free(state);