When we have tcp/ip listening sockets we want them to be reusable so we don't get stuck with a timeout when restarting the compositor.
Signed-off-by: Derek Foreman <der...@osg.samsung.com> --- src/wayland-os.c | 8 ++++++++ src/wayland-os.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/wayland-os.c b/src/wayland-os.c index 4c6ffa7..876a552 100644 --- a/src/wayland-os.c +++ b/src/wayland-os.c @@ -74,6 +74,14 @@ wl_os_socket_cloexec(int domain, int type, int protocol) return wl_os_set_cloexec_or_close(fd); } +void +wl_os_socket_reuseaddr(int fd) +{ + int on = 1; + + setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int)); +} + int wl_os_dupfd_cloexec(int fd, long minfd) { diff --git a/src/wayland-os.h b/src/wayland-os.h index 9679214..a4a2234 100644 --- a/src/wayland-os.h +++ b/src/wayland-os.h @@ -34,6 +34,9 @@ wl_os_set_cloexec_or_close(int fd); int wl_os_socket_cloexec(int domain, int type, int protocol); +void +wl_os_socket_reuseaddr(int fd); + int wl_os_dupfd_cloexec(int fd, long minfd); -- 2.7.0 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel