summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-11-24 11:09:46 +1030
committerRusty Russell <rusty@rustcorp.com.au>2009-11-24 11:09:46 +1030
commit2763df22dede72097cb080c46e2e1179615a3ea7 (patch)
tree46a9e13e11a00cb5d3acc817fba293ecff9d137f /ctdb/server/eventscript.c
parent3845c6e5b846ad0e45572d8bd9692841f01efc33 (diff)
downloadsamba-2763df22dede72097cb080c46e2e1179615a3ea7.tar.gz
samba-2763df22dede72097cb080c46e2e1179615a3ea7.tar.xz
samba-2763df22dede72097cb080c46e2e1179615a3ea7.zip
eventscript: put timeout inside ctdb_event_script_callback_v
Everyone uses the same timeout value, so just remove it from the API. If we ever need variable timeouts, that might as well be central too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 533c3e053293941d2a9484b495e78d45f478bb08)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r--ctdb/server/eventscript.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 2df941d2df..801ff4ecc9 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -735,7 +735,6 @@ static int event_script_destructor(struct ctdb_event_script_state *state)
finished
*/
static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
- struct timeval timeout,
void (*callback)(struct ctdb_context *, int, void *),
void *private_data,
const char *fmt, va_list ap)
@@ -783,7 +782,7 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
state->callback = callback;
state->private_data = private_data;
state->options = talloc_vasprintf(state, fmt, ap);
- state->timeout = timeout;
+ state->timeout = timeval_set(ctdb->tunable.script_timeout, 0);
if (state->options == NULL) {
DEBUG(DEBUG_ERR, (__location__ " could not allocate state->options\n"));
talloc_free(state);
@@ -845,7 +844,6 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
finished
*/
int ctdb_event_script_callback(struct ctdb_context *ctdb,
- struct timeval timeout,
TALLOC_CTX *mem_ctx,
void (*callback)(struct ctdb_context *, int, void *),
void *private_data,
@@ -855,7 +853,7 @@ int ctdb_event_script_callback(struct ctdb_context *ctdb,
int ret;
va_start(ap, fmt);
- ret = ctdb_event_script_callback_v(ctdb, timeout, callback, private_data, fmt, ap);
+ ret = ctdb_event_script_callback_v(ctdb, callback, private_data, fmt, ap);
va_end(ap);
return ret;
@@ -889,7 +887,6 @@ int ctdb_event_script(struct ctdb_context *ctdb, const char *fmt, ...)
va_start(ap, fmt);
ret = ctdb_event_script_callback_v(ctdb,
- timeval_set(ctdb->tunable.script_timeout, 0),
event_script_callback, &status, fmt, ap);
va_end(ap);
@@ -956,8 +953,7 @@ int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
ctdb_disable_monitoring(ctdb);
- ret = ctdb_event_script_callback(ctdb,
- timeval_set(ctdb->tunable.script_timeout, 0),
+ ret = ctdb_event_script_callback(ctdb,
state, run_eventscripts_callback, state,
"%s", (const char *)indata.dptr);