rddata.dptr = (uint8_t *)&rd;
rddata.dsize = sizeof(rd);
+ if (status == -ECANCELED) {
+ DEBUG(DEBUG_ERR,("Monitoring event was cancelled\n"));
+ goto after_change_status;
+ }
+
if (status == -ETIME) {
ctdb->event_script_timeouts++;
enum ctdb_eventscript_call call;
const char *options;
struct timeval timeout;
-
+
unsigned int current;
struct ctdb_scripts_wire *scripts;
};
/* Kill off any running monitor events to run this event. */
if (ctdb->current_monitor) {
+ struct ctdb_event_script_state *ms = talloc_get_type(ctdb->current_monitor, struct ctdb_event_script_state);
+
+ /* cancel it */
+ if (ms->callback != NULL) {
+ ms->callback->fn(ctdb, -ECANCELED, ms->callback->private_data);
+ talloc_free(ms->callback);
+ }
+
/* Discard script status so we don't save to last_status */
talloc_free(ctdb->current_monitor->scripts);
ctdb->current_monitor->scripts = NULL;