nmcli: do not save/restore terminal attrs

This is vestigal. It has been in place, because we'd be turning off echo
ourselves when asking for password and needed to make sure we'd still
terminal in original state upon unexpected termination.

This shouldn't be necessary since commit 9d95e1f175 ('clients/cli: use a
nicer password prompt') we let readline take care of this and also clean
up after itself in nmc_cleanup_readline().
This commit is contained in:
Lubomir Rintel 2022-02-16 12:10:28 +01:00
parent 365d0e49bc
commit bec857cc17

View file

@ -11,7 +11,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <termios.h>
#include <unistd.h>
#include <locale.h>
#if HAVE_EDITLINE_READLINE
@ -119,7 +118,6 @@ typedef struct {
/* --- Global variables --- */
GMainLoop *loop = NULL;
struct termios termios_orig;
NM_CACHED_QUARK_FCN("nmcli-error-quark", nmcli_error_quark);
@ -935,7 +933,6 @@ nmc_clear_sigint(void)
void
nmc_exit(void)
{
tcsetattr(STDIN_FILENO, TCSADRAIN, &termios_orig);
nmc_cleanup_readline();
exit(1);
}
@ -1026,9 +1023,6 @@ main(int argc, char *argv[])
textdomain(GETTEXT_PACKAGE);
#endif
/* Save terminal settings */
tcgetattr(STDIN_FILENO, &termios_orig);
nm_cli.return_text = g_string_new(_("Success"));
loop = g_main_loop_new(NULL, FALSE);