patch-1.3.11 linux/kernel/exit.c

Next file: linux/kernel/fork.c
Previous file: linux/kernel/dma.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.10/linux/kernel/exit.c linux/kernel/exit.c
@@ -27,18 +27,18 @@
 	struct sigaction * sa = sig + p->sigaction - 1;
 
 	/* always generate signals for traced processes ??? */
-	if (p->flags & PF_PTRACED) {
-		p->signal |= mask;
-		return 1;
+	if (!(p->flags & PF_PTRACED)) {
+		/* don't bother with ignored signals (but SIGCHLD is special) */
+		if (sa->sa_handler == SIG_IGN && sig != SIGCHLD)
+			return 0;
+		/* some signals are ignored by default.. (but SIGCONT already did its deed) */
+		if ((sa->sa_handler == SIG_DFL) &&
+		    (sig == SIGCONT || sig == SIGCHLD || sig == SIGWINCH))
+			return 0;
 	}
-	/* don't bother with ignored signals (but SIGCHLD is special) */
-	if (sa->sa_handler == SIG_IGN && sig != SIGCHLD)
-		return 0;
-	/* some signals are ignored by default.. (but SIGCONT already did its deed) */
-	if ((sa->sa_handler == SIG_DFL) &&
-	    (sig == SIGCONT || sig == SIGCHLD || sig == SIGWINCH))
-		return 0;
 	p->signal |= mask;
+	if (p->state == TASK_INTERRUPTIBLE && (p->signal & ~p->blocked))
+		wake_up_process(p);
 	return 1;
 }
 
@@ -58,7 +58,7 @@
 		return 0;
 	if ((sig == SIGKILL) || (sig == SIGCONT)) {
 		if (p->state == TASK_STOPPED)
-			p->state = TASK_RUNNING;
+			wake_up_process(p);
 		p->exit_code = 0;
 		p->signal &= ~( (1<<(SIGSTOP-1)) | (1<<(SIGTSTP-1)) |
 				(1<<(SIGTTIN-1)) | (1<<(SIGTTOU-1)) );
@@ -382,6 +382,7 @@
 	}
 fake_volatile:
 	current->flags |= PF_EXITING;
+	del_timer(&current->real_timer);
 	sem_exit();
 	exit_mmap(current);
 	free_page_tables(current);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this