summaryrefslogtreecommitdiff
path: root/usr.bin/tftp/tftp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-06 06:43:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-08-06 06:43:46 +0000
commit7f4de7e0523ff79f5dfc36baffb040ec28856bea (patch)
tree87dc39a291434eeb46b130b5a4e405526b4a8d94 /usr.bin/tftp/tftp.c
parent9d40e48734d942a6950e151e86c2be4c8e2799fc (diff)
save errno in mangly handlers
Diffstat (limited to 'usr.bin/tftp/tftp.c')
-rw-r--r--usr.bin/tftp/tftp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index faa33f7f892..eeb57d71938 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp.c,v 1.3 1997/01/17 07:13:32 millert Exp $ */
+/* $OpenBSD: tftp.c,v 1.4 1997/08/06 06:43:45 deraadt Exp $ */
/* $NetBSD: tftp.c,v 1.5 1995/04/29 05:55:25 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tftp.c,v 1.3 1997/01/17 07:13:32 millert Exp $";
+static char rcsid[] = "$OpenBSD: tftp.c,v 1.4 1997/08/06 06:43:45 deraadt Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -449,11 +449,14 @@ static void
timer(sig)
int sig;
{
+ int save_errno = errno;
timeout += rexmtval;
if (timeout >= maxtimeout) {
printf("Transfer timed out.\n");
+ errno = save_errno;
longjmp(toplevel, -1);
}
+ errno = save_errno;
longjmp(timeoutbuf, 1);
}