summaryrefslogtreecommitdiff
path: root/sbin/dump/optr.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1997-08-05 23:17:13 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1997-08-05 23:17:13 +0000
commit7489625ce7740495d6656c5b84a3445e13ac48ea (patch)
tree2acbd27325394871161a6da4dd363bfa9c3b1075 /sbin/dump/optr.c
parentfc272c3751ef58efce0d949ad8f9eac836e93a63 (diff)
Save/restore the errno when handling interrupts.
Diffstat (limited to 'sbin/dump/optr.c')
-rw-r--r--sbin/dump/optr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 285d20563f4..275d7afa22f 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: optr.c,v 1.15 1997/07/25 19:13:03 mickey Exp $ */
+/* $OpenBSD: optr.c,v 1.16 1997/08/05 23:17:11 angelos Exp $ */
/* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-static char rcsid[] = "$OpenBSD: optr.c,v 1.15 1997/07/25 19:13:03 mickey Exp $";
+static char rcsid[] = "$OpenBSD: optr.c,v 1.16 1997/08/05 23:17:11 angelos Exp $";
#endif
#endif /* not lint */
@@ -146,6 +146,8 @@ char lastmsg[BUFSIZ];
void
alarmcatch()
{
+ int save_errno = errno;
+
if (notify == 0) {
if (timeout == 0)
(void) fprintf(stderr,
@@ -164,6 +166,7 @@ alarmcatch()
signal(SIGALRM, alarmcatch);
(void) alarm(120);
timeout = 1;
+ errno = save_errno;
}
/*