Skip to content
Snippets Groups Projects
Commit f6fd745d authored by Moe Jette's avatar Moe Jette
Browse files

Don't core dump if a node is not associated with any partition.

parent 4363c17b
No related branches found
No related tags found
No related merge requests found
...@@ -384,9 +384,13 @@ static List _group_node_list(node_info_msg_t * msg) ...@@ -384,9 +384,13 @@ static List _group_node_list(node_info_msg_t * msg)
static struct partition_summary *_find_partition_summary(List l, char *name) static struct partition_summary *_find_partition_summary(List l, char *name)
{ {
ListIterator i = list_iterator_create(l); ListIterator i;
struct partition_summary *current; struct partition_summary *current = NULL;
if (name == NULL)
return current;
i = list_iterator_create(l);
while ((current = list_next(i)) != NULL) { while ((current = list_next(i)) != NULL) {
if (strcmp(current->info->name, name) == 0) if (strcmp(current->info->name, name) == 0)
break; break;
...@@ -437,10 +441,17 @@ _setup_partition_summary(partition_info_msg_t * part_ptr, ...@@ -437,10 +441,17 @@ _setup_partition_summary(partition_info_msg_t * part_ptr,
for (i = 0; i < node_ptr->record_count; i++) { for (i = 0; i < node_ptr->record_count; i++) {
node_info_t *ninfo = &node_ptr->node_array[i]; node_info_t *ninfo = &node_ptr->node_array[i];
struct partition_summary *part_sum = struct partition_summary *part_sum;
_find_partition_summary(partitions, ninfo->partition);
struct node_state_summary *node_sum = NULL; struct node_state_summary *node_sum = NULL;
if (ninfo->partition == NULL) {
if (params.verbose)
printf("Node %s is not in any partition\n\n",
ninfo->name);
continue;
}
part_sum = _find_partition_summary(partitions,
ninfo->partition);
if (part_sum == NULL) { if (part_sum == NULL) {
/* This should never happen */ /* This should never happen */
printf printf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment