aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/vt_ioctl.c')
-rw-r--r--drivers/char/vt_ioctl.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index dc8368ebb1ac..3a5d301e783b 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -672,7 +672,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
672 vc->vt_mode = tmp; 672 vc->vt_mode = tmp;
673 /* the frsig is ignored, so we set it to 0 */ 673 /* the frsig is ignored, so we set it to 0 */
674 vc->vt_mode.frsig = 0; 674 vc->vt_mode.frsig = 0;
675 put_pid(xchg(&vc->vt_pid, get_pid(task_pid(current)))); 675 put_pid(vc->vt_pid);
676 vc->vt_pid = get_pid(task_pid(current));
676 /* no switch is required -- saw@shade.msu.ru */ 677 /* no switch is required -- saw@shade.msu.ru */
677 vc->vt_newvt = -1; 678 vc->vt_newvt = -1;
678 release_console_sem(); 679 release_console_sem();
@@ -1063,12 +1064,35 @@ void reset_vc(struct vc_data *vc)
1063 vc->vt_mode.relsig = 0; 1064 vc->vt_mode.relsig = 0;
1064 vc->vt_mode.acqsig = 0; 1065 vc->vt_mode.acqsig = 0;
1065 vc->vt_mode.frsig = 0; 1066 vc->vt_mode.frsig = 0;
1066 put_pid(xchg(&vc->vt_pid, NULL)); 1067 put_pid(vc->vt_pid);
1068 vc->vt_pid = NULL;
1067 vc->vt_newvt = -1; 1069 vc->vt_newvt = -1;
1068 if (!in_interrupt()) /* Via keyboard.c:SAK() - akpm */ 1070 if (!in_interrupt()) /* Via keyboard.c:SAK() - akpm */
1069 reset_palette(vc); 1071 reset_palette(vc);
1070} 1072}
1071 1073
1074void vc_SAK(struct work_struct *work)
1075{
1076 struct vc *vc_con =
1077 container_of(work, struct vc, SAK_work);
1078 struct vc_data *vc;
1079 struct tty_struct *tty;
1080
1081 acquire_console_sem();
1082 vc = vc_con->d;
1083 if (vc) {
1084 tty = vc->vc_tty;
1085 /*
1086 * SAK should also work in all raw modes and reset
1087 * them properly.
1088 */
1089 if (tty)
1090 __do_SAK(tty);
1091 reset_vc(vc);
1092 }
1093 release_console_sem();
1094}
1095
1072/* 1096/*
1073 * Performs the back end of a vt switch 1097 * Performs the back end of a vt switch
1074 */ 1098 */