/* We're back.  Did the debugger cancel the sig?  */ 
/* We're back.  Did the debugger cancel the sig or group_exit? */ 
int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,			  struct pt_regs *regs, void *cookie){	sigset_t *mask = &current->blocked;	int signr = 0;relock:	spin_lock_irq(&current->sighand->siglock);	for (;;) {		struct k_sigaction *ka;		if (unlikely(current->signal->group_stop_count > 0) &&		    handle_group_stop())			goto relock;		signr = dequeue_signal(current, mask, info);		if (!signr)			break; /* will return 0 */		if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {			ptrace_signal_deliver(regs, cookie);			/* Let the debugger run.  */			ptrace_stop(signr, signr, info);			/* We're back.  Did the debugger cancel the sig?  */			signr = current->exit_code;			if (signr == 0)				continue;			current->exit_code = 0;			/* Update the siginfo structure if the signal has			   changed.  If the debugger wanted something			   specific in the siginfo structure then it should			   have updated *info via PTRACE_SETSIGINFO.  */			if (signr != info->si_signo) {				info->si_signo = signr;				info->si_errno = 0;				info->si_code = SI_USER;				info->si_pid = current->parent->pid;				info->si_uid = current->parent->uid;			}			/* If the (new) signal is now blocked, requeue it.  */			if (sigismember(&current->blocked, signr)) {				specific_send_sig_info(signr, info, current);				continue;			}		}		ka = &current->sighand->action[signr-1];		if (ka->sa.sa_handler == SIG_IGN) /* Do nothing.  */			continue;		if (ka->sa.sa_handler != SIG_DFL) {			/* Run the handler.  */			*return_ka = *ka;			if (ka->sa.sa_flags & SA_ONESHOT)				ka->sa.sa_handler = SIG_DFL;			break; /* will return non-zero "signr" value */		}		/*		 * Now we are doing the default action for this signal.		 */		if (sig_kernel_ignore(signr)) /* Default is nothing. */			continue;		/* Init gets no signals it doesn't want.  */		if (current->pid == 1)			continue;		if (sig_kernel_stop(signr)) {			/*			 * The default action is to stop all threads in			 * the thread group.  The job control signals			 * do nothing in an orphaned pgrp, but SIGSTOP			 * always works.  Note that siglock needs to be			 * dropped during the call to is_orphaned_pgrp()			 * because of lock ordering with tasklist_lock.			 * This allows an intervening SIGCONT to be posted.			 * We need to check for that and bail out if necessary.			 */			if (signr != SIGSTOP) {				spin_unlock_irq(&current->sighand->siglock);				/* signals can be posted during this window */				if (is_orphaned_pgrp(process_group(current)))					goto relock;				spin_lock_irq(&current->sighand->siglock);			}			if (likely(do_signal_stop(signr))) {				/* It released the siglock.  */				goto relock;			}			/*			 * We didn't actually stop, due to a race			 * with SIGCONT or something like that.			 */			continue;		}		spin_unlock_irq(&current->sighand->siglock);		/*		 * Anything else is fatal, maybe with a core dump.		 */		current->flags |= PF_SIGNALED;		if (sig_kernel_coredump(signr)) {			/*			 * If it was able to dump core, this kills all			 * other threads in the group and synchronizes with			 * their demise.  If we lost the race with another			 * thread getting here, it set group_exit_code			 * first and our do_group_exit call below will use			 * that value and ignore the one we pass it.			 */			do_coredump((long)signr, signr, regs);		}		/*		 * Death signals, no core dump.		 */		do_group_exit(signr);		/* NOTREACHED */	}	spin_unlock_irq(&current->sighand->siglock);	return signr;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/30e0fca6c1d7d26f3f2daa4dd2b12c51dadc778a/signal.c/clean/kernel/signal.c