From 62499a42e5862341c23b46815c9cdd056abeb8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20L=C3=BCbbe?= Date: Sat, 29 Sep 2007 18:47:51 +0200 Subject: [PATCH] --- yaml --- r: 65223 b: refs/heads/master c: a64314e62d89562b6fc77593648bec3acc35bf61 h: refs/heads/master i: 65221: 89844a0028c37cf32f631085ff3684817a8737c5 65219: c7bf58bdd755bbc3e554942af5ea2d145e6d6843 65215: e01ff9bda46206c6027289686f2edd14e03018a7 v: v3 --- [refs] | 2 +- trunk/drivers/char/vt_ioctl.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 2bdd1ac24442..1eeb36d107fb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ed7fdff5d6754f9ef9e47bbf0b171d3d96fb7e41 +refs/heads/master: a64314e62d89562b6fc77593648bec3acc35bf61 diff --git a/trunk/drivers/char/vt_ioctl.c b/trunk/drivers/char/vt_ioctl.c index c6f6f4209739..045e6888d15b 100644 --- a/trunk/drivers/char/vt_ioctl.c +++ b/trunk/drivers/char/vt_ioctl.c @@ -1208,15 +1208,18 @@ void change_console(struct vc_data *new_vc) /* * Send the signal as privileged - kill_pid() will * tell us if the process has gone or something else - * is awry + * is awry. + * + * We need to set vt_newvt *before* sending the signal or we + * have a race. */ + vc->vt_newvt = new_vc->vc_num; if (kill_pid(vc->vt_pid, vc->vt_mode.relsig, 1) == 0) { /* * It worked. Mark the vt to switch to and * return. The process needs to send us a * VT_RELDISP ioctl to complete the switch. */ - vc->vt_newvt = new_vc->vc_num; return; }