From: Lennart Poettering Date: Tue, 13 Feb 2018 22:56:57 +0000 (+0100) Subject: ask-password: bypass clean-up if we don't need it X-Git-Tag: v238~100^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a497a2966e39dccca0b50626972f6aaafb64fb56;p=thirdparty%2Fsystemd.git ask-password: bypass clean-up if we don't need it --- diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 25cd9eee7fb..fdb53e49bfe 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -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,