瀏覽代碼

fix tst-signal7 failure

error out on internal NPTL used signals.
Waldemar Brodkorb 8 年之前
父節點
當前提交
ea21c7610a
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      libc/signal/sigaction.c

+ 10 - 0
libc/signal/sigaction.c

@@ -25,6 +25,11 @@
 int
 __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
 {
+	if (unlikely (sig == SIGCANCEL || sig == SIGSETXID)) {
+		__set_errno (EINVAL);
+		return -1;
+	}
+
 	/* NB: kernel (as of 2.6.25) will return EINVAL
 	 * if sizeof(act->sa_mask) does not match kernel's sizeof(sigset_t).
 	 * Try to catch this problem at uclibc build time:  */
@@ -48,6 +53,11 @@ __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
 	int result;
 	struct old_kernel_sigaction kact, koact;
 
+	if (unlikely (sig == SIGCANCEL || sig == SIGSETXID)) {
+		__set_errno (EINVAL);
+		return -1;
+	}
+
 	if (act) {
 		kact.k_sa_handler = act->sa_handler;
 		kact.sa_mask = act->sa_mask.__val[0];