summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk/io.c
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2004-04-19 21:37:29 +0000
committercognet <cognet@FreeBSD.org>2004-04-19 21:37:29 +0000
commit7968cd95a05e7029bae9f50c976cced97ef9314a (patch)
tree84894fe75723e7e9104306214c3aeabe3bf2a336 /usr.bin/talk/io.c
parent281173de4aed6c4075d7e6e74d23aa99a1f88a1d (diff)
downloadFreeBSD-src-7968cd95a05e7029bae9f50c976cced97ef9314a.zip
FreeBSD-src-7968cd95a05e7029bae9f50c976cced97ef9314a.tar.gz
Handle window resizing better.
Submitted by: Cyril Nguyen Huu Obtained from: OpenBSD
Diffstat (limited to 'usr.bin/talk/io.c')
-rw-r--r--usr.bin/talk/io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c
index 6cfa7f1..00b2548 100644
--- a/usr.bin/talk/io.c
+++ b/usr.bin/talk/io.c
@@ -48,6 +48,7 @@ static const char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#include <sys/filio.h>
#include <errno.h>
+#include <signal.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
@@ -58,6 +59,8 @@ static const char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#define A_LONG_TIME 10000000
+volatile sig_atomic_t gotwinch = 0;
+
/*
* The routine to do the actual talking
*/
@@ -106,6 +109,10 @@ talk()
wait.tv_sec = A_LONG_TIME;
wait.tv_usec = 0;
nb = select(32, &read_set, 0, 0, &wait);
+ if (gotwinch) {
+ resize_display();
+ gotwinch = 0;
+ }
if (nb <= 0) {
if (errno == EINTR) {
read_set = read_template;
OpenPOWER on IntegriCloud