Description: Fix build failure with GCC 14/15
 Change the socket address length variables from size_t to socklen_t to
 match the recvfrom/getsockname signatures, add the missing <time.h>
 include, and declare test_menu/test_entry/test_selection prototypes so
 the implicit function declarations become explicit.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed
Last-Update: 2026-09-05

--- utalk-1.0.2.orig/comm.c
+++ utalk-1.0.2/comm.c
@@ -13,6 +13,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/time.h>
+#include <time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -132,7 +133,7 @@ static void drain_socket(int fd) {
   struct sockaddr_in s;
   struct timeval tv;
   int r;
-  size_t sz;
+  socklen_t sz;
   char buf[200];
   fd_set rfds;
 
@@ -172,7 +173,7 @@ static void parseanswer(struct answer *a
 
 static int recv_msg(struct sockaddr *from, struct answer *answ) {
   int n, fd;
-  size_t sz;
+  socklen_t sz;
   struct old_reply oansw;
   struct new_reply nansw;
   struct sockaddr_in sa;
@@ -217,7 +218,7 @@ static int recv_msg(struct sockaddr *fro
 static int find_daemon(char *me, char *him, srdp_u32 addr, char *machine, 
 		       int *port) {
   int n, i, r;
-  size_t sz;
+  socklen_t sz;
   struct timeval wait;
   struct sockaddr_in d, rs;
   struct mesg msg;
@@ -320,7 +321,7 @@ static int find_daemon(char *me, char *h
 /* initializations that need to be done only if using the talk daemons */
 static void init_talkd(char *h, int *port) {
   char *s, *t;
-  size_t len = sizeof(struct sockaddr_in);
+  socklen_t len = sizeof(struct sockaddr_in);
   char uh[256];
 
   strncpy(uh, h, 255);
--- utalk-1.0.2.orig/menu.h
+++ utalk-1.0.2/menu.h
@@ -84,5 +84,9 @@ extern void do_help(void);
 extern void entertopic(void);
 extern void popup_command(char *prompt);
 
+extern void test_selection(void);
+extern void test_entry(void);
+extern void test_menu(void);
+
 #endif
 
--- utalk-1.0.2.orig/srdp.c
+++ utalk-1.0.2/srdp.c
@@ -243,7 +243,7 @@ static void srdp_stufftoread(struct srdp
   struct sockaddr_in from;
   struct timeval now;
   srdp_u32 chunksize, junk, junk2;
-  size_t fromlen = sizeof(struct sockaddr_in);
+  socklen_t fromlen = sizeof(struct sockaddr_in);
   int readsize;
 
   readsize = recvfrom(info->sockfd, (char *)readbuf, MAXPACKETLEN, 0, 
@@ -499,7 +499,7 @@ int srdp_open(struct srdp_info *info) {
      /* opens the socket, adds it to the global select table, returns
 	0 if ok, -1 if error */
   int fd;
-  size_t length;
+  socklen_t length;
   struct srdp_infolist *ti;
 
   info->myaddr.sin_port = htons(info->localport);
@@ -842,7 +842,7 @@ void srdp_close(struct srdp_info *info,
   struct timeval now, next, timeout;
   fd_set readfds;
   int times = 0, acked = 0, sres, readsize;
-  size_t fromlen;
+  socklen_t fromlen;
   struct sockaddr_in from;
 
   if (cansend(info)) {

