فهرست منبع

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 سال پیش
والد
کامیت
3928c22fd7
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      tools/corosync-cfgtool.c

+ 6 - 0
tools/corosync-cfgtool.c

@@ -183,6 +183,12 @@ nodestatusget_do (enum user_action action, int brief)
 			nodeid_list[s++] = nodeid;
 			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 */
 	/* It's nice to have these in nodeid order */
 	qsort(nodeid_list, s, sizeof(uint32_t), node_compare);
 	qsort(nodeid_list, s, sizeof(uint32_t), node_compare);