summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-04-14 19:53:04 +0000
committerderaadt <deraadt@openbsd.org>2004-04-14 19:53:04 +0000
commit725e56cb86c3dd69378411ed3b6d9377b6cd194d (patch)
tree82a98e11e1a241852612741d292b371e5471eeb8
parentJersey is in fact New Jersey (or Joi'-see depending on accent) (diff)
downloadwireguard-openbsd-725e56cb86c3dd69378411ed3b6d9377b6cd194d.tar.xz
wireguard-openbsd-725e56cb86c3dd69378411ed3b6d9377b6cd194d.zip
wakeup after ^Z did not continue redraws and such. use own ^Z handler.
ok otto millert
-rw-r--r--usr.bin/systat/extern.h5
-rw-r--r--usr.bin/systat/keyboard.c10
-rw-r--r--usr.bin/systat/main.c16
3 files changed, 23 insertions, 8 deletions
diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h
index 5965752ccb5..8eabff91f78 100644
--- a/usr.bin/systat/extern.h
+++ b/usr.bin/systat/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.11 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: extern.h,v 1.12 2004/04/14 19:53:04 deraadt Exp $ */
/* $NetBSD: extern.h,v 1.3 1996/05/10 23:16:34 thorpej Exp $ */
/*-
@@ -72,6 +72,7 @@ int cmdnetstat(char *, char *);
struct cmdtab *lookup(char *);
void command(char *);
void sigdie(int);
+void sigtstp(int);
void die(void);
void sigdisplay(int);
void display(void);
@@ -117,12 +118,12 @@ void shownetstat(void);
void showpigs(void);
void showswap(void);
void status(void);
-void suspend(int);
void gethz(void);
extern volatile sig_atomic_t gotdie;
extern volatile sig_atomic_t gotdisplay;
extern volatile sig_atomic_t gotwinch;
+extern volatile sig_atomic_t gottstp;
extern double dellave;
extern WINDOW *wload;
diff --git a/usr.bin/systat/keyboard.c b/usr.bin/systat/keyboard.c
index 5117a7ac1cb..d02930efdd6 100644
--- a/usr.bin/systat/keyboard.c
+++ b/usr.bin/systat/keyboard.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyboard.c,v 1.14 2003/07/10 00:06:51 david Exp $ */
+/* $OpenBSD: keyboard.c,v 1.15 2004/04/14 19:53:04 deraadt Exp $ */
/* $NetBSD: keyboard.c,v 1.2 1995/01/20 08:51:59 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: keyboard.c,v 1.14 2003/07/10 00:06:51 david Exp $";
+static char rcsid[] = "$OpenBSD: keyboard.c,v 1.15 2004/04/14 19:53:04 deraadt Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -57,6 +57,12 @@ keyboard(void)
col = 0;
move(CMDLINE, 0);
do {
+ if (gottstp) {
+ endwin();
+ kill(getpid(), SIGSTOP);
+ gotwinch = 1;
+ gottstp = 0;
+ }
if (gotdisplay) {
display();
gotdisplay = 0;
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 51c76414b93..527d16f769c 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.28 2003/12/17 20:58:39 jmc Exp $ */
+/* $OpenBSD: main.c,v 1.29 2004/04/14 19:53:04 deraadt Exp $ */
/* $NetBSD: main.c,v 1.8 1996/05/10 23:16:36 thorpej Exp $ */
/*-
@@ -40,7 +40,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.28 2003/12/17 20:58:39 jmc Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.29 2004/04/14 19:53:04 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -133,6 +133,8 @@ main(int argc, char *argv[])
siginterrupt(SIGQUIT, 1);
signal(SIGTERM, sigdie);
siginterrupt(SIGTERM, 1);
+ signal(SIGTSTP, sigtstp);
+ siginterrupt(SIGTSTP, 1);
/*
* Initialize display. Load average appears in a one line
@@ -269,15 +271,21 @@ load(void)
volatile sig_atomic_t gotdie;
volatile sig_atomic_t gotdisplay;
volatile sig_atomic_t gotwinch;
+volatile sig_atomic_t gottstp;
void
-sigdie(signo)
- int signo;
+sigdie(int signo)
{
gotdie = 1;
}
void
+sigtstp(int signo)
+{
+ gottstp = 1;
+}
+
+void
die(void)
{
if (wnd) {