diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-02-27 16:23:56 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-15 15:42:26 +0800 |
commit | 9a960821e54b0794b1c519b493294b7222dd98d4 (patch) | |
tree | eb047c65e2a6395c5fdc146614328a1431ac11a6 | |
parent | 9939af2652ce479645eaa78e891ee06f33845a99 (diff) | |
download | petitboot-9a960821e54b0794b1c519b493294b7222dd98d4.zip petitboot-9a960821e54b0794b1c519b493294b7222dd98d4.tar.gz |
ui/ncurses: Add discover client to struct cui
.. we'll need it later.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | ui/ncurses/nc-cui.c | 9 | ||||
-rw-r--r-- | ui/ncurses/nc-cui.h | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 6ef43ee..b3fe451 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -526,7 +526,6 @@ struct cui *cui_init(void* platform_info, int (*js_map)(const struct js_event *e), int start_deamon, int dry_run) { struct cui *cui; - struct discover_client *client; unsigned int i; cui = talloc_zero(NULL, struct cui); @@ -548,15 +547,15 @@ struct cui *cui_init(void* platform_info, retry_start: for (i = start_deamon ? 2 : 10; i; i--) { - client = discover_client_init(cui->waitset, + cui->client = discover_client_init(cui->waitset, &cui_client_ops, cui); - if (client || !i) + if (cui->client || !i) break; pb_log("%s: waiting for server %d\n", __func__, i); sleep(1); } - if (!client && start_deamon) { + if (!cui->client && start_deamon) { int result; start_deamon = 0; @@ -574,7 +573,7 @@ retry_start: goto fail_client_init; } - if (!client) { + if (!cui->client) { pb_log("%s: discover_client_init failed.\n", __func__); fprintf(stderr, "%s: error: discover_client_init failed.\n", __func__); diff --git a/ui/ncurses/nc-cui.h b/ui/ncurses/nc-cui.h index abe22a8..14e4e06 100644 --- a/ui/ncurses/nc-cui.h +++ b/ui/ncurses/nc-cui.h @@ -56,6 +56,7 @@ struct cui { struct pmenu *main; struct ui_timer timer; struct waitset *waitset; + struct discover_client *client; struct pjs *pjs; void *platform_info; unsigned int default_item; |