diff options
author | Franck Bui <fbui@suse.com> | 2016-11-15 09:29:04 +0100 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2016-11-17 18:16:50 +0100 |
commit | b0eb29449e63799f8b6b3440cd865d51b90a5423 (patch) | |
tree | 173f8c1d694651032ffa63785de55e5645baac3b /src/core/execute.c | |
parent | 56fde33af1101bd7d01f1f8b2472d37ab04490c6 (diff) |
core: add 'c' in confirmation_spawn to resume the boot process
Diffstat (limited to 'src/core/execute.c')
-rw-r--r-- | src/core/execute.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 6a7ad66a21..10f73ee9b5 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -732,6 +732,12 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { return CONFIRM_EXECUTE; } + /* confirm_spawn might have been disabled while we were sleeping. */ + if (manager_is_confirm_spawn_disabled(u->manager)) { + r = 1; + goto restore_stdio; + } + e = ellipsize(cmdline, 60, 100); if (!e) { log_oom(); @@ -740,7 +746,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { } for (;;) { - r = ask_char(&c, "yfshiDj", "Execute %s? [y, f, s – h for help] ", e); + r = ask_char(&c, "yfshiDjc", "Execute %s? [y, f, s – h for help] ", e); if (r < 0) { write_confirm_error_fd(r, STDOUT_FILENO); r = CONFIRM_EXECUTE; @@ -748,6 +754,11 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { } switch (c) { + case 'c': + printf("Resuming normal execution.\n"); + manager_disable_confirm_spawn(); + r = 1; + break; case 'D': unit_dump(u, stdout, " "); continue; /* ask again */ @@ -756,7 +767,8 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { r = CONFIRM_PRETEND_FAILURE; break; case 'h': - printf(" D - dump, show the state of the unit\n" + printf(" c - continue, proceed without asking anymore\n" + " D - dump, show the state of the unit\n" " f - fail, don't execute the command and pretend it failed\n" " h - help\n" " i - info, show a short summary of the unit\n" @@ -2373,7 +2385,7 @@ static int exec_child( exec_context_tty_reset(context, params); - if (params->confirm_spawn) { + if (!manager_is_confirm_spawn_disabled(unit->manager)) { const char *vc = params->confirm_spawn; _cleanup_free_ char *cmdline = NULL; |