[PATCH weston] fbdev-backend: Support being launched from weston-launch

nerdopolis bluescreen_avenger at verizon.net
Sun Jul 28 07:36:34 PDT 2013


From: n3rdopolis <bluescreen_avenger at verizon.net>

This allows the fbdev-backend to be run from weston-launch, and have privileges to the input devices, similar to the drm-backend.
---
 src/compositor-fbdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 9c3d17e..5856675 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -833,6 +833,15 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
                                   config) < 0)
                goto out_free;
 
+       /* Check if we run fbdev-backend using weston-launch */
+       compositor->base.launcher_sock =
+               weston_environment_get_fd("WESTON_LAUNCHER_SOCK");
+       if (compositor->base.launcher_sock == -1 && geteuid() != 0) {
+               weston_log("fatal: drm backend should be run "
+                          "using weston-launch binary or as root\n");
+               goto err_compositor;
+       }
+
        compositor->udev = udev_new();
        if (compositor->udev == NULL) {
                weston_log("Failed to initialize udev context.\n");
@@ -880,6 +889,9 @@ out_udev:
 out_compositor:
        weston_compositor_shutdown(&compositor->base);
 
+err_compositor:
+       weston_compositor_shutdown(&compositor->base);
+
 out_free:
        free(compositor);
 
-- 
1.8.1.2




More information about the wayland-devel mailing list