Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 327e61d66a491b616f684677771313b060824a47
Ticket: 3599194fffffffffffffffffffffffffffffffff
compat/fake-rfc2553.c is broken
User & Date: afredd on 2013-01-02 10:44:01
Changes

  1. assignee changed to: "mdejong"
  2. cmimetype changed to: "text/plain"
  3. 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
    
    
    
    
    
    
  4. foundin changed to: "current: 8.6.0"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "afredd"
  10. subsystem changed to: "52. Portability Support"
  11. title changed to: "compat/fake-rfc2553.c is broken"
  12. type changed to: "Bug"