summaryrefslogtreecommitdiffstats
path: root/usr.bin/script/script.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-08-06 06:43:40 +0000
committerderaadt <deraadt@openbsd.org>1997-08-06 06:43:40 +0000
commitec037d0cb3af11ef6f9382c611e50979a915e15d (patch)
tree724612538eb24c742528da5828f862715a71b630 /usr.bin/script/script.c
parentdo not clobber errno in signal handlers (diff)
downloadwireguard-openbsd-ec037d0cb3af11ef6f9382c611e50979a915e15d.tar.xz
wireguard-openbsd-ec037d0cb3af11ef6f9382c611e50979a915e15d.zip
save errno in mangly handlers
Diffstat (limited to 'usr.bin/script/script.c')
-rw-r--r--usr.bin/script/script.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index d24277c2868..3fb03143b68 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: script.c,v 1.8 1997/08/04 19:25:56 deraadt Exp $ */
+/* $OpenBSD: script.c,v 1.9 1997/08/06 06:43:43 deraadt Exp $ */
/* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: script.c,v 1.8 1997/08/04 19:25:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: script.c,v 1.9 1997/08/06 06:43:43 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -201,10 +201,13 @@ void
scriptflush(signo)
int signo;
{
+ int save_errno = errno;
+
if (outcc) {
(void)fflush(fscript);
outcc = 0;
}
+ errno = save_errno;
}
void