summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2009-11-26 10:49:47 +1100
committerMartin Schwenke <martin@meltin.net>2009-11-26 10:49:47 +1100
commit8029db6a9141f306b2621bdad76915062f2e115f (patch)
treeef98352e0e521e3d22d1574e8686e5ef02210dc4 /ctdb/server/eventscript.c
parent1c7445d547f996492cec1174884a8edc4872804e (diff)
parentece15620c0ad6b192c359552352208ba2d4adc8a (diff)
downloadsamba-8029db6a9141f306b2621bdad76915062f2e115f.tar.gz
samba-8029db6a9141f306b2621bdad76915062f2e115f.tar.xz
samba-8029db6a9141f306b2621bdad76915062f2e115f.zip
Merge commit 'martins-svart/status-test-2' into status-test
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a2830594ebeb54eb51ff90999cb12370aeec6e8b)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r--ctdb/server/eventscript.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 24e08f0cf5..e04dd48db1 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -809,7 +809,12 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
ctdb->current_monitor_status_ctx = NULL;
}
+<<<<<<< HEAD:server/eventscript.c
ctdb->current_monitor_status_ctx = talloc(ctdb->monitor_event_script_ctx, struct ctdb_monitor_script_status_ctx);
+=======
+ ctdb->current_monitor_status_ctx = talloc(ctdb, struct ctdb_monitor_script_status_ctx);
+ CTDB_NO_MEMORY(ctdb, ctdb->current_monitor_status_ctx);
+>>>>>>> martins-svart/status-test-2:server/eventscript.c
ctdb->current_monitor_status_ctx->scripts = NULL;
} else {
/* any other script will first terminate any monitor event */
@@ -818,11 +823,17 @@ static int ctdb_event_script_callback_v(struct ctdb_context *ctdb,
ctdb->monitor_event_script_ctx = NULL;
}
/* and then use a context common for all non-monitor events */
+<<<<<<< HEAD:server/eventscript.c
if (ctdb->other_event_script_ctx != NULL) {
talloc_free(ctdb->other_event_script_ctx);
ctdb->other_event_script_ctx = NULL;
}
ctdb->other_event_script_ctx = talloc_new(ctdb);
+=======
+ if (ctdb->other_event_script_ctx == NULL) {
+ ctdb->other_event_script_ctx = talloc_new(ctdb);
+ }
+>>>>>>> martins-svart/status-test-2:server/eventscript.c
mem_ctx = ctdb->other_event_script_ctx;
}
@@ -994,7 +1005,11 @@ static void run_eventscripts_callback(struct ctdb_context *ctdb, int status,
return;
}
+<<<<<<< HEAD:server/eventscript.c
+=======
+/* Returns rest of string, or NULL if no match. */
+>>>>>>> martins-svart/status-test-2:server/eventscript.c
static const char *get_call(const char *p, enum ctdb_eventscript_call *call)
{
unsigned int len;
@@ -1006,6 +1021,7 @@ static const char *get_call(const char *p, enum ctdb_eventscript_call *call)
for (*call = 0; *call < ARRAY_SIZE(call_names); (*call)++) {
len = strlen(call_names[*call]);
if (strncmp(p, call_names[*call], len) == 0) {
+<<<<<<< HEAD:server/eventscript.c
/* If that's it, we're good. */
if (*p == '\0')
return p;
@@ -1014,6 +1030,12 @@ static const char *get_call(const char *p, enum ctdb_eventscript_call *call)
if (len)
return p + len;
/* Hmm, extra chars: keep looking. */
+=======
+ /* If end of string or whitespace, we're done. */
+ if (strcspn(p + len, " \t") == 0) {
+ return p + len;
+ }
+>>>>>>> martins-svart/status-test-2:server/eventscript.c
}
}
return NULL;