document the change in prompt timeout handling
[vlock.git] / src / terminal.c
blob682a18d0f8deabfea730892f50cd9c7aaf2112e5
1 #include <unistd.h>
2 #include <termios.h>
4 #include "terminal.h"
6 static struct termios term;
7 static tcflag_t lflag;
9 void secure_terminal(void)
11 /* Disable terminal echoing and signals. */
12 (void) tcgetattr(STDIN_FILENO, &term);
13 lflag = term.c_lflag;
14 term.c_lflag &= ~(ECHO | ISIG);
15 (void) tcsetattr(STDIN_FILENO, TCSANOW, &term);
18 void restore_terminal(void)
20 /* Restore the terminal. */
21 term.c_lflag = lflag;
22 (void) tcsetattr(STDIN_FILENO, TCSANOW, &term);