]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/power/process.c
freezer: task->exit_state should be treated as bolean
[linux-2.6-omap-h63xx.git] / kernel / power / process.c
index 6d566bf7085c0b4fd7803a14cbaabef07269198e..179529dc38190f8860f02ac4cc2f3def1df88895 100644 (file)
 
 static inline int freezeable(struct task_struct * p)
 {
-       if ((p == current) || 
+       if ((p == current) ||
            (p->flags & PF_NOFREEZE) ||
-           (p->exit_state == EXIT_ZOMBIE) ||
-           (p->exit_state == EXIT_DEAD))
+           (p->exit_state != 0))
                return 0;
        return 1;
 }
@@ -47,8 +46,10 @@ void refrigerator(void)
        recalc_sigpending(); /* We sent fake signal, clean it up */
        spin_unlock_irq(&current->sighand->siglock);
 
-       while (frozen(current)) {
-               current->state = TASK_UNINTERRUPTIBLE;
+       for (;;) {
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               if (!frozen(current))
+                       break;
                schedule();
        }
        pr_debug("%s left refrigerator\n", current->comm);