summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-06 04:26:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-06 04:26:01 +0000
commit8674f2f60e0970e494f3a26da350e24a135ec756 (patch)
tree53141ed4921a256277bd7498508f4ce62601c44f
parent41a552e58938720f4c8a972498a00437085965da (diff)
mark more signals that I cannot fix
-rw-r--r--lib/libcurses/tty/lib_tstp.c4
-rw-r--r--lib/libedit/sig.c18
2 files changed, 13 insertions, 9 deletions
diff --git a/lib/libcurses/tty/lib_tstp.c b/lib/libcurses/tty/lib_tstp.c
index 23e99cf453e..0e862bbcde5 100644
--- a/lib/libcurses/tty/lib_tstp.c
+++ b/lib/libcurses/tty/lib_tstp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_tstp.c,v 1.8 2001/01/22 18:02:00 millert Exp $ */
+/* $OpenBSD: lib_tstp.c,v 1.9 2001/12/06 04:26:00 deraadt Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -205,6 +205,8 @@ cleanup(int sig)
static int nested;
/*
+ * XXX signal race. The kind of comment is completely ingenius!
+ *
* Actually, doing any sort of I/O from within an signal handler is
* "unsafe". But we'll _try_ to clean up the screen and terminal
* settings on the way out.
diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c
index 3aeaab0938c..b85de1a01b2 100644
--- a/lib/libedit/sig.c
+++ b/lib/libedit/sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sig.c,v 1.5 1997/06/29 23:40:52 millert Exp $ */
+/* $OpenBSD: sig.c,v 1.6 2001/12/06 04:26:00 deraadt Exp $ */
/* $NetBSD: sig.c,v 1.3 1997/04/11 17:52:48 christos Exp $ */
/*-
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
#else
-static char rcsid[] = "$OpenBSD: sig.c,v 1.5 1997/06/29 23:40:52 millert Exp $";
+static char rcsid[] = "$OpenBSD: sig.c,v 1.6 2001/12/06 04:26:00 deraadt Exp $";
#endif
#endif /* not lint && not SCCSID */
@@ -74,6 +74,7 @@ private void
sig_handler(signo)
int signo;
{
+ int save_errno = errno;
int i;
sigset_t nset, oset;
@@ -83,18 +84,18 @@ sig_handler(signo)
switch (signo) {
case SIGCONT:
- tty_rawmode(sel);
- if (ed_redisplay(sel, 0) == CC_REFRESH)
- re_refresh(sel);
- term__flush();
+ tty_rawmode(sel); /* XXX signal race */
+ if (ed_redisplay(sel, 0) == CC_REFRESH) /* XXX signal race */
+ re_refresh(sel); /* XXX signal race */
+ term__flush(); /* XXX signal race */
break;
case SIGWINCH:
- el_resize(sel);
+ el_resize(sel); /* XXX signal race */
break;
default:
- tty_cookedmode(sel);
+ tty_cookedmode(sel); /* XXX signal race */
break;
}
@@ -105,6 +106,7 @@ sig_handler(signo)
(void)signal(signo, sel->el_signal[i]);
(void)sigprocmask(SIG_SETMASK, &oset, NULL);
(void)kill(0, signo);
+ errno = save_errno;
}