aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2022-11-15 22:37:54 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2022-11-15 22:37:54 +0000
commiteb0292d92974781023999df7f654dbcf1c057960 (patch)
tree3c5496ec39fc4a45ddce839240c8e129f20577b5
parent714f6f9c147237b49d8485e1bb9f73035f4b9407 (diff)
downloadsrc-eb0292d92974781023999df7f654dbcf1c057960.tar.gz
src-eb0292d92974781023999df7f654dbcf1c057960.zip
tftpd: cleanup
Sponsored by: Klara, Inc.
-rw-r--r--libexec/tftpd/Makefile1
-rw-r--r--libexec/tftpd/tftp-io.c4
-rw-r--r--libexec/tftpd/tftp-options.c6
-rw-r--r--libexec/tftpd/tftp-transfer.c4
-rw-r--r--libexec/tftpd/tftp-utils.c1
-rw-r--r--libexec/tftpd/tftpd.c4
6 files changed, 11 insertions, 9 deletions
diff --git a/libexec/tftpd/Makefile b/libexec/tftpd/Makefile
index b311ac8aa09e..d94df7c27074 100644
--- a/libexec/tftpd/Makefile
+++ b/libexec/tftpd/Makefile
@@ -7,7 +7,6 @@ PROG= tftpd
MAN= tftpd.8
SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c
SRCS+= tftpd.c
-WFORMAT=0
.if ${MK_TCP_WRAPPERS} != "no"
CFLAGS+= -DLIBWRAP
diff --git a/libexec/tftpd/tftp-io.c b/libexec/tftpd/tftp-io.c
index 459a81508e2b..71fd57c6a7be 100644
--- a/libexec/tftpd/tftp-io.c
+++ b/libexec/tftpd/tftp-io.c
@@ -28,13 +28,13 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <netinet/in.h>
-#include <arpa/tftp.h>
#include <arpa/inet.h>
+#include <arpa/tftp.h>
#include <assert.h>
#include <errno.h>
diff --git a/libexec/tftpd/tftp-options.c b/libexec/tftpd/tftp-options.c
index 10fb112654fd..a2dd1019f811 100644
--- a/libexec/tftpd/tftp-options.c
+++ b/libexec/tftpd/tftp-options.c
@@ -28,10 +28,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/socket.h>
#include <sys/types.h>
-#include <sys/sysctl.h>
+#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/sysctl.h>
#include <netinet/in.h>
#include <arpa/tftp.h>
@@ -91,7 +91,7 @@ option_tsize(int peer __unused, struct tftphdr *tp __unused, int mode,
if (mode == RRQ)
asprintf(&options[OPT_TSIZE].o_reply,
- "%ju", stbuf->st_size);
+ "%ju", (uintmax_t)stbuf->st_size);
else
/* XXX Allows writes of all sizes. */
options[OPT_TSIZE].o_reply =
diff --git a/libexec/tftpd/tftp-transfer.c b/libexec/tftpd/tftp-transfer.c
index 0a0c099e4c33..5c037bc38f86 100644
--- a/libexec/tftpd/tftp-transfer.c
+++ b/libexec/tftpd/tftp-transfer.c
@@ -28,11 +28,11 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/tftp.h>
diff --git a/libexec/tftpd/tftp-utils.c b/libexec/tftpd/tftp-utils.c
index d706639d51e8..24ce505ab812 100644
--- a/libexec/tftpd/tftp-utils.c
+++ b/libexec/tftpd/tftp-utils.c
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/tftp.h>
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 02fbaaf0d371..02df60c87734 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -52,8 +52,9 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/tftp.h>
@@ -68,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
+#include <time.h>
#include <unistd.h>
#include "tftp-file.h"