Re: 17/22 getaddrinfo

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

 



"Richard W.M. Jones" <rjones@xxxxxxxxxx> wrote:
> This enables the use of getaddrinfo under Windows (requires inclusion
> of the "getaddrinfo.h" header from gnulib).
>
> AI_ADDRCONFIG isn't supported by the gnulib emulation of
> getaddrinfo. There is some controversy as to whether this flag
> actually does anything useful.
> http://www.google.co.uk/search?q=AI_ADDRCONFIG

I don't know enough to comment.
If there's a good case for it, it belongs in gnulib.

If you add this, you can avoid adding those in-function #ifdefs:
Slightly cleaner, imho, even if you get a redundant (and probably
compiler-eliminated) store instruction on losing systems:

#ifndef AI_ADDRCONFIG
# define AI_ADDRCONFIG 0
#endif

> +++ src/remote_internal.c	7 Dec 2007 10:59:51 -0000
> @@ -51,6 +65,8 @@
>  #endif
>  #include <libxml/uri.h>
>
> +#include "getaddrinfo.h"
> +
>  #include "internal.h"
>  #include "driver.h"
>  #include "getaddrinfo.h"
> @@ -492,7 +509,9 @@
>          struct addrinfo hints;
>          memset (&hints, 0, sizeof hints);
>          hints.ai_socktype = SOCK_STREAM;
> +#ifdef AI_ADDRCONFIG
>          hints.ai_flags = AI_ADDRCONFIG;
> +#endif

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]