summaryrefslogtreecommitdiff
path: root/bin/pdksh
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-05 22:22:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-05 22:22:59 +0000
commit285618ff4bb8510cd68164d23f8de74d740d6ce8 (patch)
treeb25ee9328017698113c7c629edb3809718ac59e8 /bin/pdksh
parent9788e3d94e7241f57b76257d410662d813dee9df (diff)
make signal handlers errno safe
Diffstat (limited to 'bin/pdksh')
-rw-r--r--bin/pdksh/trap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/pdksh/trap.c b/bin/pdksh/trap.c
index 89640ef1d1a..9bb07c57dbd 100644
--- a/bin/pdksh/trap.c
+++ b/bin/pdksh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.4 1997/06/19 13:58:48 kstailey Exp $ */
+/* $OpenBSD: trap.c,v 1.5 1997/08/05 22:22:58 deraadt Exp $ */
/*
* signal handling
@@ -111,6 +111,7 @@ trapsig(i)
int i;
{
Trap *p = &sigtraps[i];
+ int save_errno = errno;
trap = p->set = 1;
if (p->flags & TF_DFL_INTR)
@@ -125,6 +126,7 @@ trapsig(i)
if (sigtraps[i].cursig == trapsig) /* this for SIGCHLD,SIGALRM */
sigaction(i, &Sigact_trap, (struct sigaction *) 0);
#endif /* V7_SIGNALS */
+ errno = save_errno;
return RETSIGVAL;
}