4
0
Эх сурвалжийг харах

cfgtool: Check existence of at least one of nodeid

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse 4 жил өмнө
parent
commit
3928c22fd7

+ 6 - 0
tools/corosync-cfgtool.c

@@ -183,6 +183,12 @@ nodestatusget_do (enum user_action action, int brief)
 			nodeid_list[s++] = nodeid;
 		}
 	}
+
+	if (s == 0) {
+		fprintf(stderr, "No nodes found in nodelist\n");
+		exit (EXIT_FAILURE);
+	}
+
 	/* It's nice to have these in nodeid order */
 	qsort(nodeid_list, s, sizeof(uint32_t), node_compare);