diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-12-30 14:33:21 +0100 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-01-16 18:34:10 -0800 |
commit | 541b6047b6f7d51813bb3f2f3f4559be2475d54e (patch) | |
tree | 1cb6ac28b400bc0732040979c8de615455190a31 | |
parent | cd6e4777bff468fc81994ee5533f08a76f87c1da (diff) | |
download | weston-541b6047b6f7d51813bb3f2f3f4559be2475d54e.tar.gz |
launcher: use SIGRTMIN to not conflict with xwayland
xwayland uses SIGUSR1 as startup notification. Make sure to use SIGRTMIN
for VT handling to avoid conflicts.
A bonus is SIGRT* signals can be queued multiple times, so we will be able
to correctly track them and will no longer lose signals (which wouldn't
really matter, but is confusing in logs).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
-rw-r--r-- | src/launcher-util.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/launcher-util.c b/src/launcher-util.c index ac764dc8..ad81aef7 100644 --- a/src/launcher-util.c +++ b/src/launcher-util.c @@ -342,9 +342,21 @@ setup_tty(struct weston_launcher *launcher, int tty) goto err_close; } + /* + * SIGRTMIN is used as global VT-acquire+release signal. Note that + * SIGRT* must be tested on runtime, as their exact values are not + * known at compile-time. POSIX requires 32 of them to be available. + */ + if (SIGRTMIN > SIGRTMAX) { + weston_log("not enough RT signals available: %u-%u\n", + SIGRTMIN, SIGRTMAX); + ret = -EINVAL; + goto err_close; + } + mode.mode = VT_PROCESS; - mode.relsig = SIGUSR1; - mode.acqsig = SIGUSR1; + mode.relsig = SIGRTMIN; + mode.acqsig = SIGRTMIN; if (ioctl(launcher->tty, VT_SETMODE, &mode) < 0) { weston_log("failed to take control of vt handling\n"); goto err_close; @@ -352,7 +364,7 @@ setup_tty(struct weston_launcher *launcher, int tty) loop = wl_display_get_event_loop(launcher->compositor->wl_display); launcher->vt_source = - wl_event_loop_add_signal(loop, SIGUSR1, vt_handler, launcher); + wl_event_loop_add_signal(loop, SIGRTMIN, vt_handler, launcher); if (!launcher->vt_source) goto err_close; |