1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

update ctdb_control to create a correct ctdb_vnn_map->map array

(This used to be ctdb commit e510cc89068557881688d6cada38915b3e51f8cd)
This commit is contained in:
Ronnie Sahlberg 2007-05-10 10:03:21 +10:00
parent a56a2501ac
commit 82e37a9886

View File

@ -799,13 +799,19 @@ static int control_setvnnmap(struct ctdb_context *ctdb, int argc, const char **a
generation = strtoul(argv[1], NULL, 0);
num_nodes = strtoul(argv[2], NULL, 0);
vnnmap = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 4*num_nodes);
vnnmap = talloc(ctdb, struct ctdb_vnn_map);
if (vnnmap == NULL) {
DEBUG(0,(__location__ " Unable to allocate vnn_map structure\n"));
exit(1);
}
vnnmap->generation = generation;
vnnmap->size = num_nodes;
vnnmap->map = talloc_array(vnnmap, uint32_t, vnnmap->size);
if (vnnmap->map == NULL) {
DEBUG(0,(__location__ " Unable to allocate vnn_map->map array\n"));
exit(1);
}
for (i=0;i<vnnmap->size;i++) {
vnnmap->map[i] = strtoul(argv[3+i], NULL, 0);
}