Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2010 10:14:25 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209932 - head/lib/libc/compat-43
Message-ID:  <201007121014.o6CAEP49065968@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007121014.o6CAEP49065968>