mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-09 07:18:03 +02:00
_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>
This commit is contained in:
parent
a6bb4b7be9
commit
14d72882c9
1 changed files with 0 additions and 8 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue