diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-07-09 15:37:25 -0700 |
---|---|---|
committer | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-07-09 15:54:54 -0700 |
commit | 4b77f0c4b55ff443ea06854cd12098ffce233c8a (patch) | |
tree | fce7cf5adb40f0179cd11e39cdfcf955efde2c6a | |
parent | c763f15030565eef2e8b28fdf471ef3e7dd9b933 (diff) | |
download | talos-petitboot-4b77f0c4b55ff443ea06854cd12098ffce233c8a.tar.gz talos-petitboot-4b77f0c4b55ff443ea06854cd12098ffce233c8a.zip |
Iterate over all conf file parsers
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
-rw-r--r-- | discover/kboot-parser.c | 2 | ||||
-rw-r--r-- | discover/parser.c | 8 | ||||
-rw-r--r-- | discover/yaboot-parser.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/discover/kboot-parser.c b/discover/kboot-parser.c index 23d48a4..7c7cb5d 100644 --- a/discover/kboot-parser.c +++ b/discover/kboot-parser.c @@ -133,7 +133,7 @@ static int kboot_parse(struct discover_context *dc) conf = talloc_zero(dc, struct conf_context); if (!conf) - return -1; + return 0; conf->dc = dc; conf->global_options = kboot_global_options, diff --git a/discover/parser.c b/discover/parser.c index 2b4ddd2..8f2735c 100644 --- a/discover/parser.c +++ b/discover/parser.c @@ -13,16 +13,16 @@ extern struct parser __start_parsers[], __stop_parsers[]; void iterate_parsers(struct discover_context *ctx) { struct parser *parser; + unsigned int count = 0; pb_log("trying parsers for %s\n", ctx->device_path); for (parser = __start_parsers; parser < __stop_parsers; parser++) { pb_log("\ttrying parser '%s'\n", parser->name); - /* just use a dummy device path for now */ - if (parser->parse(ctx)) - return; + count += parser->parse(ctx); } - pb_log("\tno boot_options found\n"); + if (!count) + pb_log("\tno boot_options found\n"); } static int compare_parsers(const void *a, const void *b) diff --git a/discover/yaboot-parser.c b/discover/yaboot-parser.c index 1000505..6101cd8 100644 --- a/discover/yaboot-parser.c +++ b/discover/yaboot-parser.c @@ -295,7 +295,7 @@ static int yaboot_parse(struct discover_context *dc) conf = talloc_zero(dc, struct conf_context); if (!conf) - return -1; + return 0; conf->dc = dc; conf->global_options = yaboot_global_options, |