summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-01 13:51:13 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-01-06 15:55:42 +0000
commit14d72882c9b03bb5c2f96646847b4c9e431168b1 (patch)
tree907d5d0fda7b5f0c62f94476ecd05bf77d658cce
parenta6bb4b7be996b935ddc6a20d2fa8e5bb2a9e36f5 (diff)
downloaddbus-14d72882c9b03bb5c2f96646847b4c9e431168b1.tar.gz
_dbus_listen_unix_socket: don't try to set SO_REUSEADDR
On Hurd, the setsockopt() fails. Svante Signell confirmed that on at least Linux and kFreeBSD, SO_REUSEADDR "succeeds" on Unix sockets, but doesn't have any practical effect; so rather than making the failure not issue a warning, we might as well not bother with the syscall at all. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69492 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--dbus/dbus-sysdeps-unix.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 6fd1b764..ae42f56e 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -999,7 +999,6 @@ _dbus_listen_unix_socket (const char *path,
int listen_fd;
struct sockaddr_un addr;
size_t path_len;
- unsigned int reuseaddr;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -1074,13 +1073,6 @@ _dbus_listen_unix_socket (const char *path,
strncpy (addr.sun_path, path, path_len);
}
- reuseaddr = 1;
- if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
- {
- _dbus_warn ("Failed to set socket option\"%s\": %s",
- path, _dbus_strerror (errno));
- }
-
if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
{
dbus_set_error (error, _dbus_error_from_errno (errno),