diff options
author | Geoff Levand <geoff@infradead.org> | 2012-03-30 17:20:48 -0700 |
---|---|---|
committer | Geoff Levand <geoff@infradead.org> | 2012-03-30 18:10:10 -0700 |
commit | f4c558294089f7449e6f536300ddd1aa94d2cf20 (patch) | |
tree | a9a5585a7af753e1e4ddd04a00f3f0f43e91611c /ui/ncurses/nc-cui.c | |
parent | 52b9db95764fcdee9195113d7df225634a19c9f4 (diff) | |
download | talos-petitboot-f4c558294089f7449e6f536300ddd1aa94d2cf20.tar.gz talos-petitboot-f4c558294089f7449e6f536300ddd1aa94d2cf20.zip |
Speed up --start-daemon option
Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'ui/ncurses/nc-cui.c')
-rw-r--r-- | ui/ncurses/nc-cui.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 7db482b..b9d8d79 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -556,10 +556,10 @@ struct cui *cui_init(void* platform_info, /* Loop here for scripts that just started the server. */ -start_deamon: - for (i = 10; i; i--) { +retry_start: + for (i = start_deamon ? 2 : 10; i; i--) { client = discover_client_init(&cui_client_ops, cui); - if (client) + if (client || !i) break; pb_log("%s: waiting for server %d\n", __func__, i); sleep(1); @@ -573,7 +573,7 @@ start_deamon: result = pb_start_daemon(); if (!result) - goto start_deamon; + goto retry_start; pb_log("%s: discover_client_init failed.\n", __func__); fprintf(stderr, "%s: error: discover_client_init failed.\n", |