1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00

ask-password: bypass clean-up if we don't need it

This commit is contained in:
Lennart Poettering 2018-02-13 23:56:57 +01:00
parent 0f13392851
commit a497a2966e

View File

@ -232,24 +232,18 @@ int ask_password_tty(
if (flag_file) {
notify = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
if (notify < 0) {
r = -errno;
goto finish;
}
if (notify < 0)
return -errno;
if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0) {
r = -errno;
goto finish;
}
if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0)
return -errno;
}
ttyfd = open("/dev/tty", O_RDWR|O_NOCTTY|O_CLOEXEC);
if (ttyfd >= 0) {
if (tcgetattr(ttyfd, &old_termios) < 0) {
r = -errno;
goto finish;
}
if (tcgetattr(ttyfd, &old_termios) < 0)
return -errno;
if (colors_enabled())
loop_write(ttyfd, ANSI_HIGHLIGHT,