weston-launch: do not close tty prematurely
The tty file descriptor is used in signal handling (when switching VT via SIGUSR1/SIGUSR2 for the VT_RELDISP ioctrl) and in quit() when weston-launch exits for the KDSKBMUTE/KDSKBMODE/KDSETMODE/VT_SETMODE ioctrls. This fixes VT switching when using weston-launch from a non-VT shell (e.g. ssh or from within a container). Signed-off-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
parent
7df5349763
commit
aaa5b82e61
@ -457,6 +457,9 @@ quit(struct weston_launch *wl, int status)
|
||||
if (ioctl(wl->tty, VT_SETMODE, &mode) < 0)
|
||||
fprintf(stderr, "could not reset vt handling\n");
|
||||
|
||||
if (wl->tty != STDIN_FILENO)
|
||||
close(wl->tty);
|
||||
|
||||
exit(status);
|
||||
}
|
||||
|
||||
@ -847,8 +850,6 @@ main(int argc, char *argv[])
|
||||
launch_compositor(&wl, argc - optind, argv + optind);
|
||||
|
||||
close(wl.sock[1]);
|
||||
if (wl.tty != STDIN_FILENO)
|
||||
close(wl.tty);
|
||||
|
||||
while (1) {
|
||||
struct pollfd fds[2];
|
||||
|
Loading…
Reference in New Issue
Block a user