Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/usr.bin/tftp Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/c1a546b84009
branches:  netbsd-6
changeset: 774341:c1a546b84009
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Jul 20 23:14:23 2012 +0000

description:
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.

diffstat:

 usr.bin/tftp/main.c |  7 ++++---
 usr.bin/tftp/tftp.c |  9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

diffs (74 lines):

diff -r c0b39cdcfa3b -r c1a546b84009 usr.bin/tftp/main.c
--- a/usr.bin/tftp/main.c       Fri Jul 20 23:12:47 2012 +0000
+++ b/usr.bin/tftp/main.c       Fri Jul 20 23:14:23 2012 +0000
@@ -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 @@
 #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 @@
 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 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 **);
diff -r c0b39cdcfa3b -r c1a546b84009 usr.bin/tftp/tftp.c
--- a/usr.bin/tftp/tftp.c       Fri Jul 20 23:12:47 2012 +0000
+++ b/usr.bin/tftp/tftp.c       Fri Jul 20 23:14:23 2012 +0000
@@ -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 @@
 #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 @@
 
        timeout += rexmtval;
        if (timeout >= maxtimeout) {
-               (void)printf("Transfer timed out.\n");
+               (void)printf("Transfer timed out.");
                longjmp(toplevel, -1);
        }
        longjmp(timeoutbuf, 1);



Home | Main Index | Thread Index | Old Index