]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-cui.c
ui/ncurses: Add discover client to struct cui
[petitboot] / ui / ncurses / nc-cui.c
index 6ef43ee89afa62150004c8ce96a64af1bfbad077..b3fe451dba4eaab99fc5e564c178217d09242d3d 100644 (file)
@@ -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;
        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);
        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--) {
 
 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);
                                &cui_client_ops, cui);
-               if (client || !i)
+               if (cui->client || !i)
                        break;
                pb_log("%s: waiting for server %d\n", __func__, i);
                sleep(1);
        }
 
                        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;
                int result;
 
                start_deamon = 0;
@@ -574,7 +573,7 @@ retry_start:
                goto fail_client_init;
        }
 
                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__);
                pb_log("%s: discover_client_init failed.\n", __func__);
                fprintf(stderr, "%s: error: discover_client_init failed.\n",
                        __func__);