abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 15169cda581ce42d69044d232afb38fa74c440a6
parent 3aa08a2d89ef37e3355450b31888adf263e5ce35
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 21 Mar 2014 23:08:42 +0100

Use STDIN_FILENO instead of 0

Diffstat:
abduco.c | 2+-
client.c | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 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 @@ -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 },