nixpkgs/pkgs/by-name/uu/uucp/socklen_t.patch
langsjo 7f1aeb0317 uucp: patch code for GCC 14 compilation
The original code uses `size_t` for two variables that hold the sizes of
structs, but the function they get passed to requires pointer to
`socklen_t`, which is type `unsigned int *`. As far as I can tell, using
`socklen_t` has been the standard for at least a couple decades. Stricter
GCC 14 rules made this code not compile
2025-05-10 13:56:53 +03:00

27 lines
592 B
Diff

diff --git a/unix/portnm.c b/unix/portnm.c
index 9eda4ab..019337c 100644
--- a/unix/portnm.c
+++ b/unix/portnm.c
@@ -32,7 +32,7 @@ zsysdep_port_name (ftcp_port)
#if HAVE_TCP
{
- size_t clen;
+ socklen_t clen;
struct sockaddr s;
clen = sizeof (struct sockaddr);
diff --git a/unix/tcp.c b/unix/tcp.c
index 1bbcec7..af52cab 100644
--- a/unix/tcp.c
+++ b/unix/tcp.c
@@ -395,7 +395,7 @@ ftcp_open (qconn, ibaud, fwait, fuser)
while (! FGOT_SIGNAL ())
{
sockaddr_storage speer;
- size_t clen;
+ socklen_t clen;
int onew;
pid_t ipid;