diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/vt_ioctl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index c6f6f4209739..045e6888d15b 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -1208,15 +1208,18 @@ void change_console(struct vc_data *new_vc) | |||
1208 | /* | 1208 | /* |
1209 | * Send the signal as privileged - kill_pid() will | 1209 | * Send the signal as privileged - kill_pid() will |
1210 | * tell us if the process has gone or something else | 1210 | * tell us if the process has gone or something else |
1211 | * is awry | 1211 | * is awry. |
1212 | * | ||
1213 | * We need to set vt_newvt *before* sending the signal or we | ||
1214 | * have a race. | ||
1212 | */ | 1215 | */ |
1216 | vc->vt_newvt = new_vc->vc_num; | ||
1213 | if (kill_pid(vc->vt_pid, vc->vt_mode.relsig, 1) == 0) { | 1217 | if (kill_pid(vc->vt_pid, vc->vt_mode.relsig, 1) == 0) { |
1214 | /* | 1218 | /* |
1215 | * It worked. Mark the vt to switch to and | 1219 | * It worked. Mark the vt to switch to and |
1216 | * return. The process needs to send us a | 1220 | * return. The process needs to send us a |
1217 | * VT_RELDISP ioctl to complete the switch. | 1221 | * VT_RELDISP ioctl to complete the switch. |
1218 | */ | 1222 | */ |
1219 | vc->vt_newvt = new_vc->vc_num; | ||
1220 | return; | 1223 | return; |
1221 | } | 1224 | } |
1222 | 1225 | ||