[Xcb] xcb-commit Digest, Vol 36, Issue 2

Barton C Massey bart at cs.pdx.edu
Mon Jul 7 13:49:55 PDT 2008


Thanks much for the patch!

	Bart

In message <mailman.37.1215457216.26877.xcb-commit at lists.freedesktop.org> you wrote:
> Send xcb-commit mailing list submissions to
> 	xcb-commit at lists.freedesktop.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.freedesktop.org/mailman/listinfo/xcb-commit
> or, via email, send a message with subject or body 'help' to
> 	xcb-commit-request at lists.freedesktop.org
> 
> You can reach the person managing the list at
> 	xcb-commit-owner at lists.freedesktop.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of xcb-commit digest..."
> 
> 
> Today's Topics:
> 
>    1. configure.ac src (Julien Danjou)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon,  7 Jul 2008 09:00:37 -0700 (PDT)
> From: jdanjou at kemper.freedesktop.org (Julien Danjou)
> Subject: [Xcb-commit] configure.ac src
> To: xcb-commit at lists.freedesktop.org
> Message-ID: <20080707160037.7DAC810094 at kemper.freedesktop.org>
> 
>  configure.ac   |    8 ++++++++
>  src/xcb_util.c |    7 +++++--
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> New commits:
> commit a9d15a08451c76a9250642c9f662f296196f60a0
> Author: Petr Salinger <Petr.Salinger at seznam.cz>
> Date:   Mon Jul 7 17:57:37 2008 +0200
> 
>     fix FreeBSD support
>     
>     The GNU/kFreeBSD (and BSDs in general) have a different
>     layout of struct sockaddr, sockaddr_in, sockaddr_un ...
>     
>     The first member do not have to be "sa_family",
>     they also have "sa_len" field.
>     
>     Signed-off-by: Julien Danjou <julien at danjou.info>
> 
> diff --git a/configure.ac b/configure.ac
> index 91f7ae5..8b8cbdf 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -70,6 +70,14 @@ AC_HEADER_STDC
>  AC_SEARCH_LIBS(getaddrinfo, socket)
>  AC_SEARCH_LIBS(connect, socket)
>  
> +dnl check for the sockaddr_un.sun_len member
> +AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
> +		[AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])],
> +		[],
> +		[ #include <sys/types.h>
> +		  #include <sys/un.h>
> +		])
> +								 										
>  xcbincludedir='${includedir}/xcb'
>  AC_SUBST(xcbincludedir)
>  
> diff --git a/src/xcb_util.c b/src/xcb_util.c
> index 3eacc0d..8c18d71 100644
> --- a/src/xcb_util.c
> +++ b/src/xcb_util.c
> @@ -246,13 +246,16 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port)
>  static int _xcb_open_unix(char *protocol, const char *file)
>  {
>      int fd;
> -    struct sockaddr_un addr = { AF_UNIX };
> +    struct sockaddr_un addr;
>  
>      if (protocol && strcmp("unix",protocol))
>          return -1;
>  
>      strcpy(addr.sun_path, file);
> -
> +    addr.sun_family = AF_UNIX;
> +#if HAVE_SOCKADDR_SUN_LEN
> +    addr.sun_len = SUN_LEN(&addr);
> +#endif
>      fd = socket(AF_UNIX, SOCK_STREAM, 0);
>      if(fd == -1)
>          return -1;
> 
> 
> ------------------------------
> 
> _______________________________________________
> xcb-commit mailing list
> xcb-commit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb-commit
> 
> 
> End of xcb-commit Digest, Vol 36, Issue 2
> *****************************************


More information about the Xcb mailing list