svn commit: r209932 - head/lib/libc/compat-43

Konstantin Belousov kib at FreeBSD.org
Mon Jul 12 10:14:25 UTC 2010


Author: kib
Date: Mon Jul 12 10:14:24 2010
New Revision: 209932
URL: http://svn.freebsd.org/changeset/base/209932

Log:
  For xsi_sigpause(3), remove the supplied signal from the process mask
  during sigpause(2) call. It was backward.
  Check that the signal number is valid.
  
  Reported by:	Garrett Cooper <yanegomi gmail com>
  MFC after:	1 week

Modified:
  head/lib/libc/compat-43/sigcompat.c

Modified: head/lib/libc/compat-43/sigcompat.c
==============================================================================
--- head/lib/libc/compat-43/sigcompat.c	Mon Jul 12 10:11:10 2010	(r209931)
+++ head/lib/libc/compat-43/sigcompat.c	Mon Jul 12 10:14:24 2010	(r209932)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
 #include <sys/param.h>
+#include <errno.h>
 #include <signal.h>
 #include <string.h>
 #include "un-namespace.h"
@@ -111,9 +112,16 @@ int
 xsi_sigpause(int sig)
 {
 	sigset_t set;
+	int error;
 
-	sigemptyset(&set);
-	sigaddset(&set, sig);
+	if (!_SIG_VALID(sig)) {
+		errno = EINVAL;
+		return (-1);
+	}
+	error = _sigprocmask(SIG_BLOCK, NULL, &set);
+	if (error != 0)
+		return (error);
+	sigdelset(&set, sig);
 	return (_sigsuspend(&set));
 }
 


More information about the svn-src-all mailing list