diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-01-17 14:50:54 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-01-17 16:13:33 +0800 |
commit | b1d15f894473d4b1e90ad273487a432bcd637195 (patch) | |
tree | 46aa0587653d7ec9f02ed8067bf83bc6c2735e27 /discover/user-event.c | |
parent | 44e10d816427c001d60eb5e7b3e75b740e5a2823 (diff) | |
download | petitboot-b1d15f894473d4b1e90ad273487a432bcd637195.zip petitboot-b1d15f894473d4b1e90ad273487a432bcd637195.tar.gz |
discover: Don't rely on ctx->conf_url side-effect in user_event_parse_conf_url
Currently, user_event_parse_conf_url sets dc->conf_url if it detects we
have a full URL (rather than a base URL). This is a little too subtle,
so replace it with an explicit output parameter.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/user-event.c')
-rw-r--r-- | discover/user-event.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/discover/user-event.c b/discover/user-event.c index 69e6f7d..11a54df 100644 --- a/discover/user-event.c +++ b/discover/user-event.c @@ -230,7 +230,7 @@ static char *parse_ip_addr(struct discover_context *ctx, const char *ip) } struct pb_url *user_event_parse_conf_url(struct discover_context *ctx, - struct event *event) + struct event *event, bool *is_complete) { const char *conffile, *host, *bootfile; char *p, *basedir, *url_str; @@ -255,7 +255,7 @@ struct pb_url *user_event_parse_conf_url(struct discover_context *ctx, talloc_free(url_str); } - ctx->conf_url = url; + *is_complete = true; } else { host = parse_host_addr(event); if (!host) { @@ -284,6 +284,7 @@ struct pb_url *user_event_parse_conf_url(struct discover_context *ctx, talloc_free(url_str); talloc_free(basedir); + *is_complete = false; } return url; |