summaryrefslogtreecommitdiffstats
path: root/libexec/tftpd/tftpd.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-09-24 10:40:17 +0000
committermarius <marius@FreeBSD.org>2010-09-24 10:40:17 +0000
commitb33b39bf8fca1665dc3b1f2d01092704fa9387d2 (patch)
tree2f8808cab176e2913d55c56aa2ac6b5eda69d0de /libexec/tftpd/tftpd.c
parentb9eeaa21c2c08a8a5837ece770038dd9704067f3 (diff)
downloadFreeBSD-src-b33b39bf8fca1665dc3b1f2d01092704fa9387d2.zip
FreeBSD-src-b33b39bf8fca1665dc3b1f2d01092704fa9387d2.tar.gz
Make WARNS=6 clean.
MFC after: 1 week
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 93943f5..33911ec 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;
}
-
OpenPOWER on IntegriCloud