bug-gnulib
[Top][All Lists]
Advanced

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

Re: coreutils-6.0 on BeOS (6)


From: Bruno Haible
Subject: Re: coreutils-6.0 on BeOS (6)
Date: Mon, 28 Aug 2006 15:55:55 +0200
User-agent: KMail/1.9.1

Simon Josefsson wrote:
> > The reason is that BeOS does not have PF_INET, only AF_INET, but usually 
> > they
> > have the same values. Also it doesn't have PF_UNSPEC.
> 
> Does it AF_UNSPEC?  Did you grep the entire /usr/include tree to find
> PF_INET or PF_UNSPEC?  Maybe they are in some non-standard header.

It has neither AF_UNSPEC nor PF_UNSPEC, in no header.

> > + #ifdef PF_UNSPEC /* BeOS lacks PF_UNSPEC. */
> >        if (family == PF_UNSPEC)
> >          return true;
> > + #endif
> 
> I'm not sure this will do the right thing.  Usually getaddrinfo is
> called with hints structure that is zeroed out, and only the relevant
> flags asserted.  If family isn't asserted, it usually means "take any
> family".

I see. Then what about this patch? It compiles fine on BeOS.


2006-08-26  Bruno Haible  <address@hidden>
            Simon Josefsson  <address@hidden>

        * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.

*** coreutils-6.2-cvs/lib/getaddrinfo.c 2006-08-26 21:52:06.000000000 +0200
--- coreutils-6.2-beos/lib/getaddrinfo.c        2006-08-26 23:35:16.000000000 
+0200
***************
*** 42,47 ****
--- 42,56 ----
  #include "snprintf.h"
  #include "strdup.h"
  
+ /* BeOS has AF_INET, but not PF_INET.  */
+ #ifndef PF_INET
+ # define PF_INET AF_INET
+ #endif
+ /* BeOS also lacks PF_UNSPEC.  */
+ #ifndef PF_UNSPEC
+ # define PF_UNSPEC 0
+ #endif
+ 
  #if defined _WIN32 || defined __WIN32__
  # define WIN32_NATIVE
  #endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]