[mutter/wip/wayland-work: 41/63] mutter-launch: support spawning with stdin to /dev/null
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland-work: 41/63] mutter-launch: support spawning with stdin to /dev/null
- Date: Wed, 21 Aug 2013 16:23:20 +0000 (UTC)
commit 711503fb47e3e8f5396696bba51ae6c1f6f086f5
Author: Giovanni Campagna <gcampagn redhat com>
Date: Tue Aug 20 15:45:08 2013 +0200
mutter-launch: support spawning with stdin to /dev/null
If we don't have stdin connected to a terminal, and we don't see
the -t argument, assume the terminal we want is $XDG_VTNR
https://bugzilla.gnome.org/show_bug.cgi?id=705861
src/wayland/weston-launch.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/weston-launch.c b/src/wayland/weston-launch.c
index 1faeec4..a1cf72e 100644
--- a/src/wayland/weston-launch.c
+++ b/src/wayland/weston-launch.c
@@ -365,7 +365,14 @@ setup_tty(struct weston_launch *wl, const char *tty)
else
wl->tty = open(tty, O_RDWR | O_NOCTTY);
} else {
- wl->tty = STDIN_FILENO;
+ if (isatty (STDIN_FILENO))
+ wl->tty = STDIN_FILENO;
+ else {
+ char path[PATH_MAX];
+
+ snprintf(path, PATH_MAX, "/dev/tty%s", getenv("XDG_VTNR"));
+ wl->tty = open(path, O_RDWR | O_NOCTTY);
+ }
}
if (wl->tty < 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]