Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bc3d5c5bcfa7d2bb47e87f985e59bdaf79537378
Ticket: 3599194fffffffffffffffffffffffffffffffff
compat/fake-rfc2553.c is broken
User & Date: dkf on 2013-09-24 12:00:08
Changes

  1. assignee changed to: "aku"
  2. closedate changed to: "2456560.00009796"
  3. closer changed to: "dkf"
  4. comment changed to:
    The function freeaddrinfo() in fake-rfc2553.c should be called fake_freeaddrinfo()
    since the header file fake-rfc2553.h has:
    
    #ifndef HAVE_FREEADDRINFO
    #define freeaddrinfo(a)         (fake_freeaddrinfo(a))
    void freeaddrinfo(struct addrinfo *);
    #endif /* !HAVE_FREEADDRINFO */
    
    
    When compiled it fails to find a definition for fake_freeaddrinfo!
    
    Here is a patch diff to fix this and a couple of other issues the compiler found.
    
    
    diff --git a/compat/fake-rfc2553.c b/compat/fake-rfc2553.c
    index 666144f..3bb2834 100644
    --- a/compat/fake-rfc2553.c
    +++ b/compat/fake-rfc2553.c
    @@ -84,7 +84,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
    
            if (host != NULL) {
                    if (flags & NI_NUMERICHOST) {
    -                       int len;
    +                       size_t len;
                            Tcl_MutexLock(&netdbMutex);
                            len = strlcpy(host, inet_ntoa(sin->sin_addr), hostlen);
                            Tcl_MutexUnlock(&netdbMutex);
    @@ -135,7 +135,7 @@ fake_gai_strerror(int err)
    
     #ifndef HAVE_FREEADDRINFO
     void
    -freeaddrinfo(struct addrinfo *ai)
    +fake_freeaddrinfo(struct addrinfo *ai)
     {
            struct addrinfo *next;
    
    @@ -199,7 +199,7 @@ fake_getaddrinfo(const char *hostname, const char *servname,
    
                    port = strtol(servname, &cp, 10);
                    if (port > 0 && port <= 65535 && *cp == '\0')
    -                       port = htons(port);
    +                       port = htons((unsigned short) port);
                    else if ((sp = getservbyname(servname, NULL)) != NULL)
                            port = sp->s_port;
                    else
    
  5. login: "dkf"
  6. mimetype: "text/plain"
  7. severity changed to: "Minor"
  8. status changed to: "Closed"