From 7f4de7e0523ff79f5dfc36baffb040ec28856bea Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 6 Aug 1997 06:43:46 +0000 Subject: save errno in mangly handlers --- usr.bin/tftp/tftp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.bin/tftp/tftp.c') 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 */ @@ -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); } -- cgit v1.2.3