forked from github/abduco
Use STDIN_FILENO instead of 0
This commit is contained in:
parent
3aa08a2d89
commit
15169cda58
2
abduco.c
2
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();
|
||||
|
|
|
|||
4
client.c
4
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 },
|
||||
|
|
|
|||
Loading…
Reference in New Issue