summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
402884d)
Update check_boot_option_count to check if a parser returned more than
one boot option with is_default set.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
const char *file, int line)
{
struct discover_boot_option *opt;
const char *file, int line)
{
struct discover_boot_option *opt;
+ int defaults = 0, i = 0;
- list_for_each_entry(&ctx->boot_options, opt, list)
+ list_for_each_entry(&ctx->boot_options, opt, list) {
+ if (opt->option->is_default)
+ defaults++;
+ }
+
+ if (defaults > 1) {
+ fprintf(stderr, "%s:%d: parser returned multiple default "
+ "options\n", file, line);
+ exit(EXIT_FAILURE);
+ }