From 2b6c271d372f81079294a86ad24bfdcdc959f3b9 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 18 Dec 2017 15:46:01 +0800 Subject: [PATCH] Initialize windows size --- pts.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pts.c b/pts.c index 625403bd7..e9d4d60fc 100644 --- a/pts.c +++ b/pts.c @@ -207,9 +207,6 @@ static void *watch_sigwinch(void *data) { sigaddset(&winch, SIGWINCH); do { - // Wait for a SIGWINCH - sigwait(&winch, &sig); - if (closing_time) break; // Get the new terminal size @@ -221,7 +218,7 @@ static void *watch_sigwinch(void *data) { // Set the new terminal size ioctl(slave, TIOCSWINSZ, &w); - } while (1); + } while (sigwait(&winch, &sig) == 0); free(data); return NULL; @@ -276,8 +273,6 @@ int watch_sigwinch_async(int master, int slave) { return -1; } - // Set the initial terminal size - raise(SIGWINCH); return 0; }