Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2022 22:38:46 GMT
From:      =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: eb0292d92974 - main - tftpd: cleanup
Message-ID:  <202211152238.2AFMckpO043416@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=eb0292d92974781023999df7f654dbcf1c057960

commit eb0292d92974781023999df7f654dbcf1c057960
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2022-11-15 22:37:54 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2022-11-15 22:37:54 +0000

    tftpd: cleanup
    
    Sponsored by:   Klara, Inc.
---
 libexec/tftpd/Makefile        | 1 -
 libexec/tftpd/tftp-io.c       | 4 ++--
 libexec/tftpd/tftp-options.c  | 6 +++---
 libexec/tftpd/tftp-transfer.c | 4 ++--
 libexec/tftpd/tftp-utils.c    | 1 +
 libexec/tftpd/tftpd.c         | 4 +++-
 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211152238.2AFMckpO043416>