patch-2.0.1 linux/kernel/signal.c

Next file: linux/kernel/sys.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.0/linux/kernel/signal.c linux/kernel/signal.c
@@ -91,7 +91,7 @@
  * POSIX 3.3.1.3:
  *  "Setting a signal action to SIG_IGN for a signal that is pending
  *   shall cause the pending signal to be discarded, whether or not
- *   it is blocked" (but SIGCHLD is unspecified: linux leaves it alone).
+ *   it is blocked."
  *
  *  "Setting a signal action to SIG_DFL for a signal that is pending
  *   and whose default action is to ignore the signal (for example,
@@ -108,8 +108,6 @@
 
 	p = signum - 1 + current->sig->action;
 	if (p->sa_handler == SIG_IGN) {
-		if (signum == SIGCHLD)
-			return;
 		current->signal &= ~_S(signum);
 		return;
 	}
@@ -156,18 +154,14 @@
 
 	if (signum<1 || signum>32)
 		return -EINVAL;
-	if (signum==SIGKILL || signum==SIGSTOP)
-		return -EINVAL;
 	p = signum - 1 + current->sig->action;
 	if (action) {
 		int err = verify_area(VERIFY_READ, action, sizeof(*action));
 		if (err)
 			return err;
+		if (signum==SIGKILL || signum==SIGSTOP)
+			return -EINVAL;
 		memcpy_fromfs(&new_sa, action, sizeof(struct sigaction));
-		new_sa.sa_mask |= _S(signum);
-		if (new_sa.sa_flags & SA_NOMASK)
-			new_sa.sa_mask &= ~_S(signum);
-		new_sa.sa_mask &= _BLOCKABLE;
 		if (new_sa.sa_handler != SIG_DFL && new_sa.sa_handler != SIG_IGN) {
 			err = verify_area(VERIFY_READ, new_sa.sa_handler, 1);
 			if (err)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov