From 9ae32feef793082a302e65d31514a958604c761d Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 25 Jun 2019 14:59:59 +0200 Subject: Allow partial connection to succeed Xwayland can optionally be socket-activated by the Wayland compositor, in which case it would use only the sockets provided by the compositor. However, that prevents other transport protocols from working, because when it's given a socket from the Wayland compositor, it would disable all other connections and rely solely on the given socket. Change `MakeAllCOTSServerListeners` to allow for partial connections so that if `partial` is set to a non-zero value by the caller, we do not bail out in the address is already in use. That allows to continue trying with other protocols even if the local connection fails (as this is already handled by the socket from the Wayland compositor). Related: https://gitlab.freedesktop.org/xorg/xserver/issues/817 Signed-off-by: Olivier Fourdan --- Xtrans.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Xtrans.c b/Xtrans.c index ce76120..e88b597 100644 --- a/Xtrans.c +++ b/Xtrans.c @@ -1170,6 +1170,9 @@ TRANS(MakeAllCOTSServerListeners) (const char *port, int *partial, if ((status = TRANS(CreateListener (ciptr, port, flags))) < 0) { + if (*partial != 0) + continue; + if (status == TRANS_ADDR_IN_USE) { /* -- cgit v1.2.3