svn commit: r210234 - stable/8/lib/libc/compat-43

Konstantin Belousov kib at FreeBSD.org
Mon Jul 19 12:41:06 UTC 2010


Author: kib
Date: Mon Jul 19 12:41:05 2010
New Revision: 210234
URL: http://svn.freebsd.org/changeset/base/210234

Log:
  MFC r209932:
  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.

Modified:
  stable/8/lib/libc/compat-43/sigcompat.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/compat-43/sigcompat.c
==============================================================================
--- stable/8/lib/libc/compat-43/sigcompat.c	Mon Jul 19 12:37:28 2010	(r210233)
+++ stable/8/lib/libc/compat-43/sigcompat.c	Mon Jul 19 12:41:05 2010	(r210234)
@@ -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-stable-8 mailing list