DIR *dir;
struct dirent *de;
char *script;
+ int count;
if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) {
/* we guarantee that only some specifically allowed event scripts are run
return -1;
}
+ count = 0;
while ((de=readdir(dir)) != NULL) {
int namlen;
unsigned num;
}
- /* store the event script in the tree */
- script = trbt_insert32(tree, num, talloc_strdup(tree, de->d_name));
- if (script != NULL) {
- DEBUG(DEBUG_CRIT,("CONFIG ERROR: Multiple event scripts with the same prefix : '%s' and '%s'. Each event script MUST have a unique prefix\n", script, de->d_name));
- talloc_free(tmp_ctx);
- closedir(dir);
- return -1;
- }
+ /* store the event script in the tree */
+ trbt_insert32(tree, (num<<16)|count++, talloc_strdup(tree, de->d_name));
}
closedir(dir);