summaryrefslogtreecommitdiff
path: root/src/ask-password-api.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-25 02:51:48 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-25 02:51:48 +0100
commitc0f9c7da07fccafed646e0a15df9bc132e3fc7fb (patch)
treea7f69d7121d547670f9a02fdde9d1673f1aef244 /src/ask-password-api.c
parent6d55002a69dea3b8d941c5c4e4fce80f371060b5 (diff)
systemctl: shutdown agent explicitly so that it can reset the tty properly
Diffstat (limited to 'src/ask-password-api.c')
-rw-r--r--src/ask-password-api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
index f43075e601..dd54fb6abf 100644
--- a/src/ask-password-api.c
+++ b/src/ask-password-api.c
@@ -180,7 +180,6 @@ int ask_password_tty(
}
if (ttyfd >= 0)
- loop_write(ttyfd, "\n", 1, false);
passphrase[p] = 0;
@@ -196,8 +195,11 @@ finish:
close_nointr_nofail(notify);
if (ttyfd >= 0) {
- if (reset_tty)
+
+ if (reset_tty) {
+ loop_write(ttyfd, "\n", 1, false);
tcsetattr(ttyfd, TCSADRAIN, &old_termios);
+ }
close_nointr_nofail(ttyfd);
}