From dba664d4f00955b12a6cbdc2cc2aba86ead231fd Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 7 Oct 2012 13:57:31 +0200 Subject: use abstract socket name by default, to fix bug #562; --disable-abstract-socket restores the old behavior, which is useful for debugging --- configure.ac | 13 ++++++++++--- main.c | 10 +++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index f880c5e6..890a6a80 100644 --- a/configure.ac +++ b/configure.ac @@ -111,12 +111,18 @@ AC_ARG_ENABLE(psf, [AS_HELP_STRING([--enable-psf ], [build AOSDK-based AC_ARG_ENABLE(mono2stereo, [AS_HELP_STRING([--enable-mono2stereo ], [build mono2stereo DSP plugin (default: auto)])], [enable_mono2stereo=$enableval], [enable_mono2stereo=yes]) AC_ARG_ENABLE(shellexecui, [AS_HELP_STRING([--enable-shellexecui ], [build shellexec GTK UI plugin (default: auto)])], [enable_shellexecui=$enableval], [enable_shellexecui=yes]) AC_ARG_ENABLE(alac, [AS_HELP_STRING([--enable-alac ], [build ALAC plugin (default: auto)])], [enable_alac=$enableval], [enable_alac=yes]) +AC_ARG_ENABLE(abstract_socket, [AS_HELP_STRING([--enable-abstract-socket ], [use abstract socket (default: enabled)])], [enable_alac=$enableval], [enable_abstract_socket=yes]) if test "x$enable_staticlink" != "xno" ; then AC_DEFINE_UNQUOTED([STATICLINK], [1], [Define if building static version]) STATICLINK=yes fi +if test "x$enable_abstract_socket" != "xno" ; then + AC_DEFINE_UNQUOTED([USE_ABSTRACT_SOCKET_NAME], [1], [Define to use abstract socket name, without file]) + USE_ABSTRACT_SOCKET_NAME=yes +fi + dnl check for yasm AC_CHECK_PROG(HAVE_YASM, yasm, yes, no) @@ -629,9 +635,6 @@ AM_CONDITIONAL(HAVE_TTA, test "x$HAVE_TTA" = "xyes") AM_CONDITIONAL(HAVE_DCA, test "x$HAVE_DCA" = "xyes") AM_CONDITIONAL(HAVE_AAC, test "x$HAVE_AAC" = "xyes") AM_CONDITIONAL(HAVE_MMS, test "x$HAVE_MMS" = "xyes") -AM_CONDITIONAL(STATICLINK, test "x$STATICLINK" = "xyes") -AM_CONDITIONAL(PORTABLE, test "x$PORTABLE" = "xyes") -AM_CONDITIONAL(PORTABLE_FULL, test "x$PORTABLE_FULL" = "xyes") AM_CONDITIONAL(HAVE_DSP_SRC, test "x$HAVE_DSP_SRC" = "xyes") AM_CONDITIONAL(HAVE_M3U, test "x$HAVE_M3U" = "xyes") AM_CONDITIONAL(HAVE_VFS_ZIP, test "x$HAVE_VFS_ZIP" = "xyes") @@ -648,6 +651,10 @@ AM_CONDITIONAL(HAVE_SHELLEXECUI, test "x$HAVE_SHELLEXECUI" = "xyes") AM_CONDITIONAL(HAVE_SM, test "x$HAVE_SM" = "xyes") AM_CONDITIONAL(HAVE_ICE, test "x$HAVE_ICE" = "xyes") AM_CONDITIONAL(HAVE_ALAC, test "x$HAVE_ALAC" = "xyes") +AM_CONDITIONAL(STATICLINK, test "x$STATICLINK" = "xyes") +AM_CONDITIONAL(PORTABLE, test "x$PORTABLE" = "xyes") +AM_CONDITIONAL(PORTABLE_FULL, test "x$PORTABLE_FULL" = "xyes") +AM_CONDITIONAL(USE_ABSTRACT_SOCKET_NAME, test "x$USE_ABSTRACT_SOCKET_NAME" = "xyes") AC_SUBST(PLUGINS_DIRS) diff --git a/main.c b/main.c index 466126df..51ef1914 100644 --- a/main.c +++ b/main.c @@ -61,10 +61,6 @@ #error PREFIX must be defined #endif -#ifdef __linux__ -#define USE_ABSTRACT_NAME 0 -#endif - //#define trace(...) { fprintf(stderr, __VA_ARGS__); } #define trace(fmt,...) @@ -342,7 +338,7 @@ static struct sockaddr_un srv_local; static struct sockaddr_un srv_remote; static unsigned srv_socket; -#if USE_ABSTRACT_NAME +#if USE_ABSTRACT_SOCKET_NAME static char server_id[] = "\0deadbeefplayer"; #endif @@ -363,7 +359,7 @@ server_start (void) { memset (&srv_local, 0, sizeof (srv_local)); srv_local.sun_family = AF_UNIX; -#if USE_ABSTRACT_NAME +#if USE_ABSTRACT_SOCKET_NAME memcpy (srv_local.sun_path, server_id, sizeof (server_id)); int len = offsetof(struct sockaddr_un, sun_path) + sizeof (server_id)-1; #else @@ -859,7 +855,7 @@ main (int argc, char *argv[]) { memset (&remote, 0, sizeof (remote)); remote.sun_family = AF_UNIX; -#if USE_ABSTRACT_NAME +#if USE_ABSTRACT_SOCKET_NAME memcpy (remote.sun_path, server_id, sizeof (server_id)); len = offsetof(struct sockaddr_un, sun_path) + sizeof (server_id)-1; #else -- cgit v1.2.3