From 0a1f69319573dc1153594c0319180e5bf47d756d Mon Sep 17 00:00:00 2001 From: Wulf C. Krueger Date: Mon, 30 Aug 2010 22:45:12 +0000 Subject: [PATCH] Failure in configure test for abstract sockets. --- configure.in | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 2950297..40a5f92 100644 --- a/configure.in +++ b/configure.in @@ -690,6 +690,7 @@ AC_CACHE_CHECK([abstract socket namespace], #include ]], [[ + size_t slen; int listen_fd; struct sockaddr_un addr; @@ -704,9 +705,13 @@ AC_CACHE_CHECK([abstract socket namespace], memset (&addr, '\0', sizeof (addr)); addr.sun_family = AF_UNIX; strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test"); + /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the + * beginning. + */ + slen = SUN_LEN(&addr); addr.sun_path[0] = '\0'; /* this is what makes it abstract */ - if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0) + if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0) { fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", strerror (errno)); -- 1.7.2.2