Control: tags -1 + patch

I tested, and the problem is that gcc-14 how report an error when 'int'
is used instead of the proper 'socklen_t' type, at least on
architectures where socklen_t is not int but unsigned int. :)

The following patch should solve the issue:

--- ident2-1.07.orig/common.c
+++ ident2-1.07/common.c
@@ -209,7 +209,8 @@ _send_random_reply (cl_t *cl)
 static cl_t *
 _new_cl (int sd, char *line)
 {
-       int uid, ssiz = sizeof (struct sockaddr);
+       int uid;
+       socklen_t ssiz = sizeof (struct sockaddr);
        cl_t *p, cl;
        char *s;
 
--- ident2-1.07.orig/daemon.c
+++ ident2-1.07/daemon.c
@@ -83,7 +83,7 @@ static void
 declient (int s)
 {
        struct sockaddr sin;
-       int ss = sizeof (sin);
+       socklen_t ss = sizeof (sin);
        close (accept (s, (struct sockaddr *)&sin, &ss));
 }
 
@@ -94,7 +94,7 @@ static void _sig_ign (int s) { return; }
 static int
 _accept_connect (int sv, struct sockaddr_in *sin)
 {
-       size_t sl = sizeof (struct sockaddr_in);
+       socklen_t sl = sizeof (struct sockaddr_in);
        int cl;
 
        while ((cl = accept(sv, (struct sockaddr *)sin, &sl)) == -1) {
--- ident2-1.07.orig/ident2.c
+++ ident2-1.07/ident2.c
@@ -49,10 +49,10 @@ static int
 inetd_child (void)
 {
        struct sockaddr_in sin;
-       int sinsize = sizeof (struct sockaddr_in);
+       socklen_t sinsize = sizeof (struct sockaddr_in);
 
                /* if child of inetd, 0 would be a socket */
-       if (getsockname (0, (struct sockaddr *)&sin, (int *)&sinsize) == -1) {
+       if (getsockname (0, (struct sockaddr *)&sin, &sinsize) == -1) {
                if (errno == ENOTSOCK)
                        return 0;       /* must be a filedescriptor */
                else {

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to