[PATCH] Reverses the order of a socket creation in weston/compositor.c

Kristian Hoegsberg hoegsberg at gmail.com
Wed Feb 29 09:02:09 PST 2012


On Wed, Feb 29, 2012 at 10:22:23AM +0100, Igor Makarov wrote:
> Hello all,
> So, when I trying to start weston with 'wayland-backend.so' on ARM
> device I got errors related to socket connection. 
> This error appear because 'backed_init' start client-socket connection
> to server-socket that is absent at that moment. This patch reverses the
> order of a socket creation.

Hi,

wayland-backend is for running the compositor under another Wayland
compositor.  As such it needs to connect to the Wayland socket of the
host compositor, which is what it's trying to do when you get the
error.  If you're actually trying to do that you have to run it
something like this:

  $ weston --socket wayland-1 --backend=wayland-backend.so

Otherwise, you should try to run with the drm-backend.so (for running
on KMS, ie without X) or to run with x11-backend.so (as a window under
X11).

Kristian

> ---
>  src/compositor.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/compositor.c b/src/compositor.c
> index 74c40da..80cbcf9 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -2493,6 +2493,11 @@ int main(int argc, char *argv[])
>  	if (!shell_init)
>  		exit(EXIT_FAILURE);
>  
> +	if (wl_display_add_socket(display, option_socket_name)) {
> +		fprintf(stderr, "failed to add socket: %m\n");
> +		exit(EXIT_FAILURE);
> +	}
> +
>  	ec = backend_init(display, backend_options);
>  	if (ec == NULL) {
>  		fprintf(stderr, "failed to create compositor\n");
> @@ -2508,11 +2513,6 @@ int main(int argc, char *argv[])
>  	if (shell_init(ec) < 0)
>  		exit(EXIT_FAILURE);
>  
> -	if (wl_display_add_socket(display, option_socket_name)) {
> -		fprintf(stderr, "failed to add socket: %m\n");
> -		exit(EXIT_FAILURE);
> -	}
> -
>  	weston_compositor_wake(ec);
>  	if (setjmp(segv_jmp_buf) == 0)
>  		wl_display_run(display);
> -- 
> 1.7.4.1
> 
> 
> -- 
> Igor Makarov
> igor.makarov at lge.com
> 
> Research Engineer
> LG Electronics, Russia R&D Lab
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list