diff options
author | Franck Bui <fbui@suse.com> | 2016-11-10 10:07:42 +0100 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2016-11-17 18:16:51 +0100 |
commit | 63d77c9254aee1f965df5574c98c2fa83b50567c (patch) | |
tree | 0123e6203d2d52d1d83e245040d0d4a53c954e61 /src/core | |
parent | b0eb29449e63799f8b6b3440cd865d51b90a5423 (diff) |
core: include the unit name when notifying that a confirmation question timed out
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/execute.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 10f73ee9b5..c7b324ffa8 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -669,18 +669,18 @@ static int setup_confirm_stdio(const char *vc, int *_saved_stdin, int *_saved_st return 0; } -static void write_confirm_error_fd(int err, int fd) { +static void write_confirm_error_fd(int err, int fd, const Unit *u) { assert(err < 0); if (err == -ETIMEDOUT) - dprintf(fd, "Confirmation question timed out, assuming positive response.\n"); + dprintf(fd, "Confirmation question timed out for %s, assuming positive response.\n", u->id); else { errno = -err; - dprintf(fd, "Couldn't ask confirmation: %m, assuming positive response.\n"); + dprintf(fd, "Couldn't ask confirmation for %s: %m, assuming positive response.\n", u->id); } } -static void write_confirm_error(int err, const char *vc) { +static void write_confirm_error(int err, const char *vc, const Unit *u) { _cleanup_close_ int fd = -1; assert(vc); @@ -689,7 +689,7 @@ static void write_confirm_error(int err, const char *vc) { if (fd < 0) return; - write_confirm_error_fd(err, fd); + write_confirm_error_fd(err, fd, u); } static int restore_confirm_stdio(int *saved_stdin, int *saved_stdout) { @@ -728,7 +728,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { /* For any internal errors, assume a positive response. */ r = setup_confirm_stdio(vc, &saved_stdin, &saved_stdout); if (r < 0) { - write_confirm_error(r, vc); + write_confirm_error(r, vc, u); return CONFIRM_EXECUTE; } @@ -748,7 +748,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { for (;;) { r = ask_char(&c, "yfshiDjc", "Execute %s? [y, f, s – h for help] ", e); if (r < 0) { - write_confirm_error_fd(r, STDOUT_FILENO); + write_confirm_error_fd(r, STDOUT_FILENO, u); r = CONFIRM_EXECUTE; goto restore_stdio; } |