From 15169cda581ce42d69044d232afb38fa74c440a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 21 Mar 2014 23:08:42 +0100 Subject: [PATCH] Use STDIN_FILENO instead of 0 --- abduco.c | 2 +- client.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/abduco.c b/abduco.c index 6c58a27..8cc5908 100644 --- a/abduco.c +++ b/abduco.c @@ -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(); diff --git a/client.c b/client.c index b60d326..87a62fc 100644 --- a/client.c +++ b/client.c @@ -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 },