Reverting all the dbus related commits (sigh) from 27th July and fixing a QA issue...
[oespirit1] / sapwood / socket.patch
1 diff --git a/configure.in b/configure.in
2 index bd36a9b..6f85678 100644
3 --- configure.in
4 +++ configure.in
5 @@ -14,51 +14,52 @@ AC_PROG_INSTALL
6  AC_PROG_MAKE_SET
7  
8  dnl abstract sockets namespace checks, from dbus
9 -AC_ARG_ENABLE(abstract-sockets,
10 -             [AC_HELP_STRING([--enable-abstract-sockets],
11 -                             [use abstract socket namespace (linux only)])],
12 -             [enable_abstract_sockets=$enableval],
13 -             [enable_abstract_sockets=auto])
14 -
15 -AC_MSG_CHECKING(abstract socket namespace)
16 -AC_RUN_IFELSE([AC_LANG_PROGRAM(
17 -[[
18 +#AC_ARG_ENABLE(abstract-sockets,
19 +#            [AC_HELP_STRING([--enable-abstract-sockets],
20 +#                            [use abstract socket namespace (linux only)])],
21 +#            [enable_abstract_sockets=$enableval],
22 +#            [enable_abstract_sockets=auto])
23 +#
24 +#AC_MSG_CHECKING(abstract socket namespace)
25 +#AC_RUN_IFELSE([AC_LANG_PROGRAM(
26 +#[[
27  #include <sys/types.h>
28  #include <stdlib.h>
29  #include <stdio.h>
30  #include <sys/socket.h>
31  #include <sys/un.h>
32  #include <errno.h>
33 -]],
34 -[[
35 -  int listen_fd;
36 -  struct sockaddr_un addr;
37 -
38 -  listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
39 -
40 -  if (listen_fd < 0)
41 -    {
42 -      fprintf (stderr, "socket() failed: %s\n", strerror (errno));
43 -      exit (1);
44 -    }
45 -
46 -  memset (&addr, '\0', sizeof (addr));
47 -  addr.sun_family = AF_UNIX;
48 -  strcpy (addr.sun_path, "X/tmp/sapwood-fake-socket-path-used-in-configure-test");
49 -  addr.sun_path[0] = '\0'; /* this is what makes it abstract */
50 -
51 -  if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
52 -    {
53 -      fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
54 -               strerror (errno));
55 -      exit (1);
56 -    }
57 -  else
58 -    exit (0);
59 -]])],
60 -  [have_abstract_sockets=yes],
61 -  [have_abstract_sockets=no])
62 -AC_MSG_RESULT($have_abstract_sockets)
63 +#]],
64 +#[[
65 +#  int listen_fd;
66 +#  struct sockaddr_un addr;
67 +#
68 +#  listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
69 +#
70 +#  if (listen_fd < 0)
71 +#    {
72 +#      fprintf (stderr, "socket() failed: %s\n", strerror (errno));
73 +#      exit (1);
74 +#    }
75 +#
76 +#  memset (&addr, '\0', sizeof (addr));
77 +#  addr.sun_family = AF_UNIX;
78 +#  strcpy (addr.sun_path, "X/tmp/sapwood-fake-socket-path-used-in-configure-test");
79 +#  addr.sun_path[0] = '\0'; /* this is what makes it abstract */
80 +#
81 +#  if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
82 +#    {
83 +#      fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
84 +#               strerror (errno));
85 +#      exit (1);
86 +#    }
87 +#  else
88 +#    exit (0);
89 +#]])],
90 +#  [have_abstract_sockets=yes],
91 +#  [have_abstract_sockets=no])
92 +#AC_MSG_RESULT($have_abstract_sockets)
93 +enable_abstract_socket=no
94  
95  if test x$enable_abstract_sockets = xyes; then
96    if test x$have_abstract_sockets = xno; then