[PATCH weston 4/4] shell: Fix client shell pointer assignment

Tiago Vignatti tiago.vignatti at intel.com
Thu Apr 4 14:07:40 PDT 2013


weston_client_launch() might return a client pointer that will not be the
actual one the shell client is binding. Therefore, assign the pointer only
later after the interface is already bound.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 src/shell.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index f23b855..0365ba6 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3360,12 +3360,8 @@ launch_desktop_shell_process(void *data)
 {
 	struct desktop_shell *shell = data;
 
-	shell->child.client = weston_client_launch(shell->compositor,
-						 &shell->child.process,
-						 shell->child.path,
-						 desktop_shell_sigchld);
-
-	if (!shell->child.client)
+	if (!weston_client_launch(shell->compositor, &shell->child.process,
+				   shell->child.path, desktop_shell_sigchld))
 		weston_log("not able to start %s\n", shell->child.path);
 }
 
@@ -3405,6 +3401,7 @@ bind_desktop_shell(struct wl_client *client,
 
 	wl_client_get_credentials(client, &pid, NULL, NULL);
 	if (pid == shell->child.process.pid || pid == getpid()) {
+		shell->child.client = client;
 		resource->destroy = unbind_desktop_shell;
 		shell->child.desktop_shell = resource;
 		return;
-- 
1.7.9.5



More information about the wayland-devel mailing list