[PATCH 4/4] compositor: work around tty checking so gdb works

Jesse Barnes jbarnes at virtuousgeek.org
Mon Jan 16 14:40:49 PST 2012


This lets me run Weston as root in an ssh window and gdb and get stdout.
---
 src/compositor-drm.c |    3 ++-
 src/tty.c            |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 9e25ffd..1751e72 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1147,13 +1147,14 @@ drm_compositor_create(struct wl_display *display,
 	}
 
 	ec->base.wl_display = display;
+#if 0
 	ec->tty = tty_create(&ec->base, vt_func, tty);
 	if (!ec->tty) {
 		fprintf(stderr, "failed to initialize tty\n");
 		free(ec);
 		return NULL;
 	}
-
+#endif
 	e = udev_enumerate_new(ec->udev);
 	udev_enumerate_add_match_subsystem(e, "drm");
 	udev_enumerate_add_match_sysname(e, "card[0-9]*");
diff --git a/src/tty.c b/src/tty.c
index 7b68ff1..fd9259f 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -111,14 +111,14 @@ tty_create(struct weston_compositor *compositor, tty_vt_func_t vt_func,
 		fprintf(stderr, "failed to open tty: %m\n");
 		return NULL;
 	}
-
+#if 0
 	if (fstat(tty->fd, &buf) < 0 ||
 	    major(buf.st_rdev) != TTY_MAJOR || minor(buf.st_rdev) == 0) {
 		fprintf(stderr, "stdin not a vt (%d, %d)\n",
 			major(buf.st_dev), minor(buf.st_dev));
 		return NULL;
 	}
-
+#endif
 	if (tcgetattr(tty->fd, &tty->terminal_attributes) < 0) {
 		fprintf(stderr, "could not get terminal attributes: %m\n");
 		return NULL;
-- 
1.7.4.1



More information about the wayland-devel mailing list