mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Initialise eventscript status earlier
Don't initialise it after ctdb_event_script_callback_v() may have short-circuited. This can stop ctdb_event_script_args() from ever terminating. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
070964dbcf
commit
d30b529ccc
@ -864,7 +864,10 @@ int ctdb_event_script_args(struct ctdb_context *ctdb, enum ctdb_eventscript_call
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
struct callback_status status;
|
||||
struct callback_status status = {
|
||||
.status = -1,
|
||||
.done = false,
|
||||
};
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret = ctdb_event_script_callback_v(ctdb, ctdb,
|
||||
@ -874,9 +877,6 @@ int ctdb_event_script_args(struct ctdb_context *ctdb, enum ctdb_eventscript_call
|
||||
return ret;
|
||||
}
|
||||
|
||||
status.status = -1;
|
||||
status.done = false;
|
||||
|
||||
while (status.done == false && event_loop_once(ctdb->ev) == 0) /* noop */;
|
||||
|
||||
if (status.status == -ETIME) {
|
||||
|
Loading…
Reference in New Issue
Block a user