Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: basesrc



>Does this work as expected?

        for me yes.

>The hack for inetd was necessary because getaddrinfo doesn't return
>EAI_ADDRFAMILY (or, an appropriate error code for the situation) when
>``kernel doesn't support the address family'' was expected, wasn't it?
>
>And that's why I asked why getaddrinfo doesn't return such error code.

        your problem actually has two sides:
        1. when the specified service name ("ftp") was not available,
           EAI_SERVICE will be returned.  gai_strerror(EAI_SERVICE) is,
           as defined in RFC, "servname not supported for ai_socktype".
           this is far less friendly than "unknown service".
        2. when host == NULL and ai_family is not supported by the kernel,
           EAI_FAMILY will be returned.  gai_strerror(EAI_FAMILY) is
           "ai_family not supported".  this is not that bad, but not friendly
           enough IMHO.

        so i tried to address both of them.  I think 1. is the one you've asked.

>IMHO, single printf with gai_strerror should be enough, shouldn't it?

        in general yes, but sometimes the string returned by gai_strerror()
        is cryptic to normal users.

itojun



Home | Main Index | Thread Index | Old Index