Module Name:    src
Committed By:   riz
Date:           Fri Jul 20 23:14:23 UTC 2012

Modified Files:
        src/usr.bin/tftp [netbsd-6]: main.c tftp.c

Log Message:
Pull up following revision(s) (requested by he in ticket #425):
        usr.bin/tftp/main.c: revision 1.32
        usr.bin/tftp/tftp.c: revision 1.34
Undo the non-sharing of the "toplevel" jmp_buf between main.c and tftp.c,
so that we don't get a core dump if a transfer time-out is experienced.
Also, get rid of an extranous newline printed in the case of time-out.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.2.1 src/usr.bin/tftp/main.c
cvs rdiff -u -r1.32 -r1.32.4.1 src/usr.bin/tftp/tftp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tftp/main.c
diff -u src/usr.bin/tftp/main.c:1.30 src/usr.bin/tftp/main.c:1.30.2.1
--- src/usr.bin/tftp/main.c:1.30	Mon Jan 16 17:38:16 2012
+++ src/usr.bin/tftp/main.c	Fri Jul 20 23:14:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.30 2012/01/16 17:38:16 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.30.2.1 2012/07/20 23:14:23 riz Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.30 2012/01/16 17:38:16 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.30.2.1 2012/07/20 23:14:23 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -87,6 +87,8 @@ u_int	rexmtval = TIMEOUT;
 ushort	mcmasterslave;
 int	maxtimeout = 5 * TIMEOUT;
 
+jmp_buf	toplevel;
+
 static int	connected;
 static char	mode[32];
 static char	line[LBUFLEN];
@@ -94,7 +96,6 @@ static int	margc;
 static char	*margv[20];
 static const	char *prompt = "tftp";
 static char    hostname[MAXHOSTNAMELEN];
-static jmp_buf	toplevel;
 
 static void	get(int, char **);
 static void	help(int, char **);

Index: src/usr.bin/tftp/tftp.c
diff -u src/usr.bin/tftp/tftp.c:1.32 src/usr.bin/tftp/tftp.c:1.32.4.1
--- src/usr.bin/tftp/tftp.c:1.32	Sat Sep 17 15:15:46 2011
+++ src/usr.bin/tftp/tftp.c	Fri Jul 20 23:14:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: tftp.c,v 1.32 2011/09/17 15:15:46 christos Exp $	*/
+/*	$NetBSD: tftp.c,v 1.32.4.1 2012/07/20 23:14:23 riz Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tftp.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: tftp.c,v 1.32 2011/09/17 15:15:46 christos Exp $");
+__RCSID("$NetBSD: tftp.c,v 1.32.4.1 2012/07/20 23:14:23 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -67,9 +67,10 @@ __RCSID("$NetBSD: tftp.c,v 1.32 2011/09/
 #include "extern.h"
 #include "tftpsubs.h"
 
+extern jmp_buf	toplevel;
+
 char    ackbuf[PKTSIZE];
 int	timeout;
-jmp_buf	toplevel;
 jmp_buf	timeoutbuf;
 
 static void nak __P((int, struct sockaddr *));
@@ -761,7 +762,7 @@ timer(sig)
 
 	timeout += rexmtval;
 	if (timeout >= maxtimeout) {
-		(void)printf("Transfer timed out.\n");
+		(void)printf("Transfer timed out.");
 		longjmp(toplevel, -1);
 	}
 	longjmp(timeoutbuf, 1);

Reply via email to