Use STDIN_FILENO instead of 0

This commit is contained in:
Marc André Tanner 2014-03-21 23:08:42 +01:00
parent 3aa08a2d89
commit 15169cda58
2 changed files with 3 additions and 3 deletions

View File

@ -350,7 +350,7 @@ static bool attach_session(const char *name) {
cur_term.c_cc[VLNEXT] = _POSIX_VDISABLE;
cur_term.c_cc[VMIN] = 1;
cur_term.c_cc[VTIME] = 0;
tcsetattr(0, TCSADRAIN, &cur_term);
tcsetattr(STDIN_FILENO, TCSADRAIN, &cur_term);
int status = client_mainloop();
client_restore_terminal();

View File

@ -30,7 +30,7 @@ static void client_show_cursor() {
static void client_restore_terminal() {
if (has_term)
tcsetattr(0, TCSADRAIN, &orig_term);
tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_term);
client_show_cursor();
}
@ -44,7 +44,7 @@ static int client_mainloop() {
if (client.need_resize) {
struct winsize ws;
if (ioctl(0, TIOCGWINSZ, &ws) != -1) {
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) != -1) {
Packet pkt = {
.type = MSG_RESIZE,
.u = { .ws = ws },