]> err.no Git - linux-2.6/blobdiff - drivers/char/vt.c
[PATCH] remove verify_area(): remove verify_area() from various uaccess.h headers
[linux-2.6] / drivers / char / vt.c
index e5ef1dfc54826a33b4b86e9347b8584087bda831..27b6c297906a12954068010f18ee694a5e3b268c 100644 (file)
@@ -2272,7 +2272,9 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
                        ret = paste_selection(tty);
                        break;
                case TIOCL_UNBLANKSCREEN:
+                       acquire_console_sem();
                        unblank_screen();
+                       release_console_sem();
                        break;
                case TIOCL_SELLOADLUT:
                        ret = sel_loadlut(p);
@@ -2317,8 +2319,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
                        }
                        break;
                case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */
+                       acquire_console_sem();
                        ignore_poke = 1;
                        do_blank_screen(0);
+                       release_console_sem();
                        break;
                case TIOCL_BLANKEDSCREEN:
                        ret = console_blanked;
@@ -2433,7 +2437,7 @@ static int con_open(struct tty_struct *tty, struct file *filp)
        int ret = 0;
 
        acquire_console_sem();
-       if (tty->count == 1) {
+       if (tty->driver_data == NULL) {
                ret = vc_allocate(currcons);
                if (ret == 0) {
                        struct vc_data *vc = vc_cons[currcons].d;
@@ -2796,7 +2800,7 @@ void do_blank_screen(int entering_gfx)
                return;
 
        if (vesa_off_interval) {
-               blank_state = blank_vesa_wait,
+               blank_state = blank_vesa_wait;
                mod_timer(&console_timer, jiffies + vesa_off_interval);
        }
 
@@ -2867,6 +2871,10 @@ void unblank_screen(void)
  */
 static void blank_screen_t(unsigned long dummy)
 {
+       if (unlikely(!keventd_up())) {
+               mod_timer(&console_timer, jiffies + blankinterval);
+               return;
+       }
        blank_timer_expired = 1;
        schedule_work(&console_work);
 }