summaryrefslogtreecommitdiffstats
path: root/lib/libedit/sig.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libedit/sig.c')
-rw-r--r--lib/libedit/sig.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c
index babec69..f37a12e 100644
--- a/lib/libedit/sig.c
+++ b/lib/libedit/sig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sig.c,v 1.17 2011/07/28 20:50:55 christos Exp $ */
+/* $NetBSD: sig.c,v 1.24 2016/02/16 19:08:41 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: sig.c,v 1.17 2011/07/28 20:50:55 christos Exp $");
+__RCSID("$NetBSD: sig.c,v 1.24 2016/02/16 19:08:41 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
@@ -48,9 +48,12 @@ __FBSDID("$FreeBSD$");
* our policy is to trap all signals, set a good state
* and pass the ball to our caller.
*/
-#include "el.h"
+#include <errno.h>
#include <stdlib.h>
+#include "el.h"
+#include "common.h"
+
private EditLine *sel = NULL;
private const int sighdl[] = {
@@ -70,9 +73,10 @@ private void sig_handler(int);
private void
sig_handler(int signo)
{
- int i;
+ int i, save_errno;
sigset_t nset, oset;
+ save_errno = errno;
(void) sigemptyset(&nset);
(void) sigaddset(&nset, signo);
(void) sigprocmask(SIG_BLOCK, &nset, &oset);
@@ -106,6 +110,7 @@ sig_handler(int signo)
sigemptyset(&sel->el_signal->sig_action[i].sa_mask);
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
(void) kill(0, signo);
+ errno = save_errno;
}
OpenPOWER on IntegriCloud