struct termios term;
struct termios oterm;
struct vt_mode ovtm;
- uid_t uid;
struct passwd *pw;
-/* XXX: xgetpwuid */
- uid = getuid();
- pw = getpwuid(uid);
- if (pw == NULL)
- bb_error_msg_and_die("unknown uid %d", (int)uid);
+ pw = xgetpwuid(getuid());
opt_complementary = "=0"; /* no params! */
getopt32(argv, "a");
term.c_iflag |= IGNBRK;
term.c_lflag &= ~ISIG;
term.c_lflag &= ~(ECHO | ECHOCTL);
- tcsetattr(STDIN_FILENO, TCSANOW, &term);
+ tcsetattr_stdin_TCSANOW(&term);
do {
printf("Virtual console%s locked by %s.\n",
} while (1);
ioctl(STDIN_FILENO, VT_SETMODE, &ovtm);
- tcsetattr(STDIN_FILENO, TCSANOW, &oterm);
+ tcsetattr_stdin_TCSANOW(&oterm);
fflush_stdout_and_exit(EXIT_SUCCESS);
}