summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-18 01:47:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-18 01:47:07 +0000
commit5b042f440adda7bc137437043f4d87ee3fc4bd6d (patch)
tree391aa8bca6c264a517daaa4f419b096b0471b753 /bin
parent974fee2ffa01d4d7fdc8553bbf9dc02481d62afb (diff)
another errno save situation
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/trap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ksh/trap.c b/bin/ksh/trap.c
index 7ed32e84e19..e8f94ef11ee 100644
--- a/bin/ksh/trap.c
+++ b/bin/ksh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.11 2001/09/19 10:58:07 mpech Exp $ */
+/* $OpenBSD: trap.c,v 1.12 2001/12/18 01:47:06 deraadt Exp $ */
/*
* signal handling
@@ -70,6 +70,8 @@ static RETSIGTYPE
alarm_catcher(sig)
int sig;
{
+ int errno_ = errno;
+
if (ksh_tmout_state == TMOUT_READING) {
int left = alarm(0);
@@ -79,6 +81,7 @@ alarm_catcher(sig)
} else
alarm(left);
}
+ errno = errno_;
return RETSIGVAL;
}
#endif /* KSH */
@@ -124,7 +127,7 @@ trapsig(i)
int i;
{
Trap *p = &sigtraps[i];
- int save_errno = errno;
+ int errno_ = errno;
trap = p->set = 1;
if (p->flags & TF_DFL_INTR)
@@ -139,7 +142,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;
+ errno = errno_;
return RETSIGVAL;
}