Commit 4e411da3 authored by Wulf C. Krueger's avatar Wulf C. Krueger Committed by Simon McVittie

Fix failure in configure test for abstract sockets

Bug: default avatarSimon McVittie <>
parent a144bf49
......@@ -694,6 +694,7 @@ AC_CACHE_CHECK([abstract socket namespace],
#include <errno.h>
size_t slen;
int listen_fd;
struct sockaddr_un addr;
......@@ -708,9 +709,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));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment