aboutsummaryrefslogtreecommitdiff
path: root/libexec/tftpd/tftpd.c
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2010-09-24 10:40:17 +0000
committerMarius Strobl <marius@FreeBSD.org>2010-09-24 10:40:17 +0000
commit04ebad38428c939dcc6c0fdeecd601282ae49fab (patch)
tree2f8808cab176e2913d55c56aa2ac6b5eda69d0de /libexec/tftpd/tftpd.c
parent295fbd498e5c871af68078de919e165968daf69f (diff)
downloadsrc-04ebad38428c939dcc6c0fdeecd601282ae49fab.tar.gz
src-04ebad38428c939dcc6c0fdeecd601282ae49fab.zip
Make WARNS=6 clean.
MFC after: 1 week
Notes
Notes: svn path=/head/; revision=213099
Diffstat (limited to 'libexec/tftpd/tftpd.c')
-rw-r--r--libexec/tftpd/tftpd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 93943f5b43d8..33911ec48018 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -97,7 +97,7 @@ static int suppress_naks;
static int logging;
static int ipchroot;
static int create_new = 0;
-static char *newfile_format = "%Y%m%d";
+static const char *newfile_format = "%Y%m%d";
static int increase_name = 0;
static mode_t mask = S_IWGRP | S_IWOTH;
@@ -785,7 +785,6 @@ static void
tftp_xmitfile(int peer, const char *mode)
{
uint16_t block;
- uint32_t amount;
time_t now;
struct tftp_stats ts;
@@ -799,13 +798,12 @@ tftp_xmitfile(int peer, const char *mode)
read_close();
if (debug&DEBUG_SIMPLE)
tftp_log(LOG_INFO, "Sent %d bytes in %d seconds",
- amount, time(NULL) - now);
+ ts.amount, time(NULL) - now);
}
static void
tftp_recvfile(int peer, const char *mode)
{
- uint32_t filesize;
uint16_t block;
struct timeval now1, now2;
struct tftp_stats ts;
@@ -820,6 +818,7 @@ tftp_recvfile(int peer, const char *mode)
tftp_receive(peer, &block, &ts, NULL, 0);
write_close();
+ gettimeofday(&now2, NULL);
if (debug&DEBUG_SIMPLE) {
double f;
@@ -832,9 +831,8 @@ tftp_recvfile(int peer, const char *mode)
(now2.tv_usec - now1.tv_usec) / 100000.0;
tftp_log(LOG_INFO,
"Download of %d bytes in %d blocks completed after %0.1f seconds\n",
- filesize, block, f);
+ ts.amount, block, f);
}
return;
}
-