]> Pileus Git - ~andy/linux/blobdiff - kernel/signal.c
pid namespaces: prepare proc_flust_task() to flush entries from multiple proc trees
[~andy/linux] / kernel / signal.c
index 7929523810928d9aa405aa74cb2e390a6083491f..8214ffad54bcebbbe63b639115d0bd983ba55101 100644 (file)
@@ -99,7 +99,6 @@ static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
 static int recalc_sigpending_tsk(struct task_struct *t)
 {
        if (t->signal->group_stop_count > 0 ||
-           (freezing(t)) ||
            PENDING(&t->pending, &t->blocked) ||
            PENDING(&t->signal->shared_pending, &t->blocked)) {
                set_tsk_thread_flag(t, TIF_SIGPENDING);
@@ -257,7 +256,7 @@ flush_signal_handlers(struct task_struct *t, int force_default)
 
 int unhandled_signal(struct task_struct *tsk, int sig)
 {
-       if (is_init(tsk))
+       if (is_global_init(tsk))
                return 1;
        if (tsk->ptrace & PT_PTRACED)
                return 0;
@@ -537,7 +536,7 @@ static int check_kill_permission(int sig, struct siginfo *info,
                        return error;
                error = -EPERM;
                if (((sig != SIGCONT) ||
-                       (process_session(current) != process_session(t)))
+                       (task_session_nr(current) != task_session_nr(t)))
                    && (current->euid ^ t->suid) && (current->euid ^ t->uid)
                    && (current->uid ^ t->suid) && (current->uid ^ t->uid)
                    && !capable(CAP_KILL))
@@ -909,8 +908,7 @@ __group_complete_signal(int sig, struct task_struct *p)
                        do {
                                sigaddset(&t->pending.signal, SIGKILL);
                                signal_wake_up(t, 1);
-                               t = next_thread(t);
-                       } while (t != p);
+                       } while_each_thread(p, t);
                        return;
                }
 
@@ -928,13 +926,11 @@ __group_complete_signal(int sig, struct task_struct *p)
                rm_from_queue(SIG_KERNEL_STOP_MASK, &p->signal->shared_pending);
                p->signal->group_stop_count = 0;
                p->signal->group_exit_task = t;
-               t = p;
+               p = t;
                do {
                        p->signal->group_stop_count++;
-                       signal_wake_up(t, 0);
-                       t = next_thread(t);
-               } while (t != p);
-               wake_up_process(p->signal->group_exit_task);
+                       signal_wake_up(t, t == p);
+               } while_each_thread(p, t);
                return;
        }
 
@@ -985,9 +981,6 @@ void zap_other_threads(struct task_struct *p)
        p->signal->flags = SIGNAL_GROUP_EXIT;
        p->signal->group_stop_count = 0;
 
-       if (thread_group_empty(p))
-               return;
-
        for (t = next_thread(p); t != p; t = next_thread(t)) {
                /*
                 * Don't bother with already dead threads
@@ -1846,7 +1839,7 @@ relock:
                 * within that pid space. It can of course get signals from
                 * its parent pid space.
                 */
-               if (current == child_reaper(current))
+               if (current == task_child_reaper(current))
                        continue;
 
                if (sig_kernel_stop(signr)) {
@@ -2300,15 +2293,6 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
        k = &current->sighand->action[sig-1];
 
        spin_lock_irq(&current->sighand->siglock);
-       if (signal_pending(current)) {
-               /*
-                * If there might be a fatal signal pending on multiple
-                * threads, make sure we take it before changing the action.
-                */
-               spin_unlock_irq(&current->sighand->siglock);
-               return -ERESTARTNOINTR;
-       }
-
        if (oact)
                *oact = *k;
 
@@ -2335,7 +2319,6 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
                        rm_from_queue_full(&mask, &t->signal->shared_pending);
                        do {
                                rm_from_queue_full(&mask, &t->pending);
-                               recalc_sigpending_and_wake(t);
                                t = next_thread(t);
                        } while (t != current);
                }