}
/* Set terminal settings to reasonable defaults */
-static void set_term(int fd)
+static void set_term(void)
{
struct termios tty;
- tcgetattr(fd, &tty);
+ tcgetattr(STDIN_FILENO, &tty);
/* set control chars */
tty.c_cc[VINTR] = 3; /* C-c */
tty.c_lflag =
ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
- tcsetattr(fd, TCSANOW, &tty);
+ tcsetattr(STDIN_FILENO, TCSANOW, &tty);
}
static void console_init(void)
open_new_terminal(a->terminal, 1);
/* Make sure the terminal will act fairly normal for us */
- set_term(0);
+ set_term();
/* Setup stdout, stderr for the new process so
* they point to the supplied terminal */
dup(0);
open_new_terminal(a->terminal, 0);
/* Make sure the terminal will act fairly normal for us */
- set_term(0);
+ set_term();
/* Setup stdout, stderr on the supplied terminal */
dup(0);
dup(0);
close(2);
if (device_open(console, O_RDWR | O_NOCTTY) == 0) {
- set_term(0);
+ set_term();
close(0);
}