summaryrefslogtreecommitdiff
path: root/sbin/restore
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-06 01:45:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-06 01:45:27 +0000
commit9d40e48734d942a6950e151e86c2be4c8e2799fc (patch)
tree0209e961ea2493dcc4fa52d3b8670147993d191d /sbin/restore
parent2cc42eb6c340fb27ad8a95412f788354f0ed5a66 (diff)
do not clobber errno in signal handlers
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/interactive.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 43b49a11699..80aace5fc74 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interactive.c,v 1.4 1997/07/05 20:51:22 millert Exp $ */
+/* $OpenBSD: interactive.c,v 1.5 1997/08/06 01:45:26 deraadt Exp $ */
/* $NetBSD: interactive.c,v 1.10 1997/03/19 08:42:52 lukem Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)interactive.c 8.3 (Berkeley) 9/13/94";
#else
-static char rcsid[] = "$OpenBSD: interactive.c,v 1.4 1997/07/05 20:51:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: interactive.c,v 1.5 1997/08/06 01:45:26 deraadt Exp $";
#endif
#endif /* not lint */
@@ -54,6 +54,7 @@ static char rcsid[] = "$OpenBSD: interactive.c,v 1.4 1997/07/05 20:51:22 millert
#include <setjmp.h>
#include <glob.h>
#include <stdio.h>
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -772,8 +773,11 @@ void
onintr(signo)
int signo;
{
+ int save_errno = errno;
+
if (command == 'i' && runshell)
longjmp(reset, 1);
if (reply("restore interrupted, continue") == FAIL)
exit(1);
+ errno = save_errno;
}