[Midnightbsd-cvs] src: usr.bin/tftp: sync tftp client

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Dec 9 13:25:53 EST 2008


Log Message:
-----------
sync tftp client

Modified Files:
--------------
    src/usr.bin/tftp:
        main.c (r1.1.1.1 -> r1.2)
        tftp.1 (r1.1.1.1 -> r1.2)
        tftp.c (r1.1.1.1 -> r1.2)

-------------- next part --------------
Index: tftp.c
===================================================================
RCS file: /home/cvs/src/usr.bin/tftp/tftp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.bin/tftp/tftp.c -L usr.bin/tftp/tftp.c -u -r1.1.1.1 -r1.2
--- usr.bin/tftp/tftp.c
+++ usr.bin/tftp/tftp.c
@@ -38,7 +38,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/tftp/tftp.c,v 1.11 2002/05/12 01:47:50 bsd Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tftp/tftp.c,v 1.13 2006/09/28 21:22:21 matteo Exp $");
 
 /* Many bug fixes are from Jim Guyton <guyton at rand-unix> */
 
@@ -105,7 +105,7 @@
 	volatile int size, convert;
 	volatile unsigned long amount;
 	struct sockaddr_storage from;
-	int fromlen;
+	socklen_t fromlen;
 	FILE *file;
 	struct sockaddr_storage peer;
 	struct sockaddr_storage serv;	/* valid server port number */
@@ -205,6 +205,7 @@
 	stopclock();
 	if (amount > 0)
 		printstats("Sent", amount);
+	txrx_error = 1;
 }
 
 /*
@@ -223,7 +224,7 @@
 	volatile int size, firsttrip;
 	volatile unsigned long amount;
 	struct sockaddr_storage from;
-	int fromlen;
+	socklen_t fromlen;
 	FILE *file;
 	volatile int convert;		/* true if converting crlf -> lf */
 	struct sockaddr_storage peer;
@@ -330,6 +331,7 @@
 	stopclock();
 	if (amount > 0)
 		printstats("Received", amount);
+	txrx_error = 1;
 }
 
 static int
Index: tftp.1
===================================================================
RCS file: /home/cvs/src/usr.bin/tftp/tftp.1,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.bin/tftp/tftp.1 -L usr.bin/tftp/tftp.1 -u -r1.1.1.1 -r1.2
--- usr.bin/tftp/tftp.1
+++ usr.bin/tftp/tftp.1
@@ -30,14 +30,14 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)tftp.1	8.2 (Berkeley) 4/18/94
-.\" $FreeBSD: src/usr.bin/tftp/tftp.1,v 1.19 2005/01/18 13:43:53 ru Exp $
+.\" $FreeBSD: src/usr.bin/tftp/tftp.1,v 1.19.10.1 2007/11/14 19:25:04 ru Exp $
 .\"
 .Dd October 1, 2003
 .Dt TFTP 1
 .Os
 .Sh NAME
 .Nm tftp
-.Nd trivial file transfer program
+.Nd "trivial file transfer program"
 .Sh SYNOPSIS
 .Nm
 .Op Ar host Op Ar port
@@ -55,26 +55,28 @@
 uses
 .Ar host
 as the default host for future transfers (see the
-.Cm connect
+.Ic connect
 command below).
 .Sh COMMANDS
 Once
 .Nm
 is running, it issues the prompt
-.Dq Li tftp>
+.Dq Li "tftp> "
 and recognizes the following commands:
 .Pp
-.Bl -tag -width verbose -compact
-.It Cm \&? Ar command-name ...
+.Bl -tag -width ".Ic verbose" -compact
+.It Ic \&? Ar command-name ...
 Print help information.
 .Pp
-.It Cm ascii
-Shorthand for "mode ascii"
+.It Ic ascii
+Shorthand for
+.Ic mode Cm ascii .
+.Pp
+.It Ic binary
+Shorthand for
+.Ic mode Cm binary .
 .Pp
-.It Cm binary
-Shorthand for "mode binary"
-.Pp
-.It Cm connect Ar host Op Ar port
+.It Ic connect Ar host Op Ar port
 Set the
 .Ar host
 (and optionally
@@ -86,19 +88,19 @@
 .Tn FTP
 protocol,
 does not maintain connections between transfers; thus, the
-.Cm connect
+.Ic connect
 command does not actually create a connection,
 but merely remembers what host is to be used for transfers.
 You do not have to use the
-.Cm connect
+.Ic connect
 command; the remote host can be specified as part of the
-.Cm get
+.Ic get
 or
-.Cm put
+.Ic put
 commands.
 .Pp
-.It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname
-.It Cm get Xo
+.It Ic get Oo Ar host : Oc Ns Ar file Op Ar localname
+.It Ic get Xo
 .Oo Ar host1 : Oc Ns Ar file1
 .Oo Ar host2 : Oc Ns Ar file2 ...
 .Oo Ar hostN : Oc Ns Ar fileN
@@ -124,18 +126,18 @@
 colons used in the IPv6 address from the colon separating the host and
 the filename.
 .Pp
-.It Cm mode Ar transfer-mode
+.It Ic mode Ar transfer-mode
 Set the mode for transfers;
 .Ar transfer-mode
 may be one of
-.Em ascii
+.Cm ascii
 or
-.Em binary .
+.Cm binary .
 The default is
-.Em ascii .
+.Cm ascii .
 .Pp
-.It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename
-.It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory
+.It Ic put Ar file Op Oo Ar host : Oc Ns Ar remotename
+.It Ic put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory
 Put a file or set of files to the remote host.
 When
 .Ar remotename
@@ -150,27 +152,27 @@
 To specify an IPv6 numeric address for a
 .Ar host ,
 see the example under the
-.Cm get
+.Ic get
 command.
 .Pp
-.It Cm quit
+.It Ic quit
 Exit
 .Nm .
 An end of file also exits.
 .Pp
-.It Cm rexmt Ar retransmission-timeout
+.It Ic rexmt Ar retransmission-timeout
 Set the per-packet retransmission timeout, in seconds.
 .Pp
-.It Cm status
+.It Ic status
 Show current status.
 .Pp
-.It Cm timeout Ar total-transmission-timeout
+.It Ic timeout Ar total-transmission-timeout
 Set the total transmission timeout, in seconds.
 .Pp
-.It Cm trace
+.It Ic trace
 Toggle packet tracing.
 .Pp
-.It Cm verbose
+.It Ic verbose
 Toggle verbose mode.
 .El
 .Sh HISTORY
Index: main.c
===================================================================
RCS file: /home/cvs/src/usr.bin/tftp/main.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.bin/tftp/main.c -L usr.bin/tftp/main.c -u -r1.1.1.1 -r1.2
--- usr.bin/tftp/main.c
+++ usr.bin/tftp/main.c
@@ -44,7 +44,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/tftp/main.c,v 1.21 2003/10/12 00:27:55 tjr Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tftp/main.c,v 1.22 2005/10/19 15:37:42 stefanf Exp $");
 
 /* Many bug fixes are from Jim Guyton <guyton at rand-unix> */
 
@@ -635,7 +635,7 @@
 	if (vrbose) {
 		el = el_init("tftp", stdin, stdout, stderr);
 		hist = history_init();
-		history(hist, &he, H_EVENT, 100);
+		history(hist, &he, H_SETSIZE, 100);
 		el_set(el, EL_HIST, history, hist);
 		el_set(el, EL_EDITOR, "emacs");
 		el_set(el, EL_PROMPT, command_prompt);


More information about the Midnightbsd-cvs mailing list