From: Marco d'Itri <md@linux.it>
Date: Sat, 14 May 2022 02:57:49 +0800
Subject: fix_warnings2

---
 clean_exit.c   | 1 +
 fakelog.c      | 8 ++++----
 hosts_access.c | 4 ++++
 inetcf.c       | 2 ++
 misc.c         | 1 +
 options.c      | 1 +
 percent_x.c    | 1 +
 rfc931.c       | 1 +
 safe_finger.c  | 9 ++++++++-
 tcpd.c         | 5 ++++-
 tcpdchk.c      | 4 ++++
 tcpdmatch.c    | 1 +
 try-from.c     | 2 +-
 update.c       | 1 +
 14 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/clean_exit.c b/clean_exit.c
index cb9d4f5..41caaf0 100644
--- a/clean_exit.c
+++ b/clean_exit.c
@@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit.c 1.4 94/12/28 17:42:19";
 #endif
 
 #include <stdio.h>
+#include <unistd.h>
 
 extern void exit();
 
diff --git a/fakelog.c b/fakelog.c
index fa9e06e..97802db 100644
--- a/fakelog.c
+++ b/fakelog.c
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
 
 /* ARGSUSED */
 
-openlog(name, logopt, facility)
+void openlog(name, logopt, facility)
 char   *name;
 int     logopt;
 int     facility;
@@ -27,7 +27,7 @@ int     facility;
 
 /* vsyslog - format one record */
 
-vsyslog(severity, fmt, ap)
+void vsyslog(severity, fmt, ap)
 int     severity;
 char   *fmt;
 va_list ap;
@@ -43,7 +43,7 @@ va_list ap;
 
 /* VARARGS */
 
-VARARGS(syslog, int, severity)
+void VARARGS(syslog, int, severity)
 {
     va_list ap;
     char   *fmt;
@@ -56,7 +56,7 @@ VARARGS(syslog, int, severity)
 
 /* closelog - dummy */
 
-closelog()
+void closelog()
 {
     /* void */
 }
diff --git a/hosts_access.c b/hosts_access.c
index cd73d8f..6486dde 100644
--- a/hosts_access.c
+++ b/hosts_access.c
@@ -34,6 +34,7 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <syslog.h>
 #include <ctype.h>
 #include <errno.h>
@@ -54,6 +55,9 @@ extern int errno;
 
 #include "tcpd.h"
 
+unsigned long cidr_mask_addr(char *str);
+int yp_get_default_domain(char **ptr);
+
 /* Error handling. */
 
 extern jmp_buf tcpd_buf;
diff --git a/inetcf.c b/inetcf.c
index 49aa2f7..22200c8 100644
--- a/inetcf.c
+++ b/inetcf.c
@@ -12,6 +12,7 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <string.h>
 
@@ -20,6 +21,7 @@ extern void exit();
 
 #include "tcpd.h"
 #include "inetcf.h"
+#include "scaffold.h"
 
  /*
   * Network configuration files may live in unusual places. Here are some
diff --git a/misc.c b/misc.c
index 1eb3334..61014d4 100644
--- a/misc.c
+++ b/misc.c
@@ -13,6 +13,7 @@ static char sccsic[] = "@(#) misc.c 1.2 96/02/11 17:01:29";
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "tcpd.h"
diff --git a/options.c b/options.c
index 7a21ca0..2156d84 100644
--- a/options.c
+++ b/options.c
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#) options.c 1.17 96/02/11 17:01:31";
 #include <netinet/in.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <syslog.h>
 #include <pwd.h>
diff --git a/percent_x.c b/percent_x.c
index 1b5b83d..a100697 100644
--- a/percent_x.c
+++ b/percent_x.c
@@ -17,6 +17,7 @@ static char sccsid[] = "@(#) percent_x.c 1.4 94/12/28 17:42:37";
 /* System libraries. */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <syslog.h>
 #include <string.h>
 
diff --git a/rfc931.c b/rfc931.c
index ef22f2d..d9d7251 100644
--- a/rfc931.c
+++ b/rfc931.c
@@ -16,6 +16,7 @@ static char sccsid[] = "@(#) rfc931.c 1.10 95/01/02 16:11:34";
 /* System libraries. */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <syslog.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/safe_finger.c b/safe_finger.c
index 0886832..0b2d0dd 100644
--- a/safe_finger.c
+++ b/safe_finger.c
@@ -22,10 +22,15 @@ static char sccsid[] = "@(#) safe_finger.c 1.4 94/12/28 17:42:41";
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/wait.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <ctype.h>
 #include <pwd.h>
+#include <grp.h>
 #include <syslog.h>
 
 extern void exit();
@@ -45,6 +50,8 @@ int     finger_pid;
 int	allow_severity = SEVERITY;
 int	deny_severity = LOG_WARNING;
 
+int     pipe_stdin(char **argv);
+
 void    cleanup(sig)
 int     sig;
 {
@@ -52,7 +59,7 @@ int     sig;
     exit(0);
 }
 
-main(argc, argv)
+int main(argc, argv)
 int     argc;
 char  **argv;
 {
diff --git a/tcpd.c b/tcpd.c
index f02daae..7dd33f8 100644
--- a/tcpd.c
+++ b/tcpd.c
@@ -22,6 +22,7 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32";
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <stdio.h>
+#include <unistd.h>
 #include <syslog.h>
 #include <string.h>
 
@@ -38,10 +39,12 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32";
 #include "patchlevel.h"
 #include "tcpd.h"
 
+void fix_options(struct request_info *);
+
 int     allow_severity = SEVERITY;	/* run-time adjustable */
 int     deny_severity = LOG_WARNING;	/* ditto */
 
-main(argc, argv)
+int main(argc, argv)
 int     argc;
 char  **argv;
 {
diff --git a/tcpdchk.c b/tcpdchk.c
index 4931e99..ced93c3 100644
--- a/tcpdchk.c
+++ b/tcpdchk.c
@@ -28,6 +28,8 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02:13:25";
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <syslog.h>
 #include <setjmp.h>
 #include <errno.h>
@@ -53,6 +55,8 @@ extern char *optarg;
 #include "inetcf.h"
 #include "scaffold.h"
 
+unsigned long cidr_mask_addr(char *str);
+
 /* list of programs which are known to be linked with libwrap in debian */
 static const char *const libwrap_programs[] = {
     "portmap", "mountd", "statd", "ugidd",
diff --git a/tcpdmatch.c b/tcpdmatch.c
index b45ff2d..06764ce 100644
--- a/tcpdmatch.c
+++ b/tcpdmatch.c
@@ -26,6 +26,7 @@ static char sccsid[] = "@(#) tcpdmatch.c 1.5 96/02/11 17:01:36";
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <unistd.h>
 #include <syslog.h>
 #include <setjmp.h>
 #include <string.h>
diff --git a/try-from.c b/try-from.c
index 925e144..a246d4c 100644
--- a/try-from.c
+++ b/try-from.c
@@ -37,7 +37,7 @@ static char sccsid[] = "@(#) try-from.c 1.2 94/12/28 17:42:55";
 int     allow_severity = SEVERITY;	/* run-time adjustable */
 int     deny_severity = LOG_WARNING;	/* ditto */
 
-main(argc, argv)
+int main(argc, argv)
 int     argc;
 char  **argv;
 {
diff --git a/update.c b/update.c
index 34aafc7..5370f2d 100644
--- a/update.c
+++ b/update.c
@@ -20,6 +20,7 @@ static char sccsid[] = "@(#) update.c 1.1 94/12/28 17:42:56";
 /* System libraries */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <syslog.h>
 #include <string.h>
 
