summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-11-04 12:20:20 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-11-04 12:20:20 +0000
commit0aeebedada3924f59efd910e7da1bf10071bc3fd (patch)
treea39dbcbee2b69f45f82032227075fd9d6da04b94 /usr.bin
parent63c85a2d1361de3cf21e43d011176c9540067523 (diff)
simple SIGWINCH handler; deals only with window size changes >= 80x24
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/extern.h3
-rw-r--r--usr.bin/systat/main.c20
2 files changed, 20 insertions, 3 deletions
diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h
index 75c0e1c8a27..cf93d43a021 100644
--- a/usr.bin/systat/extern.h
+++ b/usr.bin/systat/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.5 1997/07/15 13:42:05 kstailey Exp $ */
+/* $OpenBSD: extern.h,v 1.6 1997/11/04 12:20:18 kstailey Exp $ */
/* $NetBSD: extern.h,v 1.3 1996/05/10 23:16:34 thorpej Exp $ */
/*-
@@ -111,6 +111,7 @@ WINDOW *opennetstat __P((void));
WINDOW *openpigs __P((void));
WINDOW *openswap __P((void));
int prefix __P((char *, char *));
+void resize __P((int));
void showiostat __P((void));
void showkre __P((void));
void showmbufs __P((void));
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index c6958a39045..bc2f89a3733 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 1997/08/25 19:05:26 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.14 1997/11/04 12:20:19 kstailey Exp $ */
/* $NetBSD: main.c,v 1.8 1996/05/10 23:16:36 thorpej Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: main.c,v 1.13 1997/08/25 19:05:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.14 1997/11/04 12:20:19 kstailey Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -191,6 +191,7 @@ main(argc, argv)
dellave = 0.0;
signal(SIGALRM, display);
+ signal(SIGWINCH, resize);
display(0);
noecho();
crmode();
@@ -282,6 +283,21 @@ die(signo)
exit(0);
}
+void
+resize(signo)
+ int signo;
+{
+ int oldmask;
+
+#define mask(s) (1 << ((s) - 1))
+ oldmask = sigblock(mask(SIGALRM));
+ clearok(curscr, TRUE);
+ wrefresh(curscr);
+ sigsetmask(oldmask);
+#undef mask
+}
+
+
#ifdef __STDC__
#include <stdarg.h>
#else