svn commit: r248065 - user/dchagin/lemul/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Fri Mar 8 19:16:25 UTC 2013


Author: dchagin
Date: Fri Mar  8 19:16:24 2013
New Revision: 248065
URL: http://svnweb.freebsd.org/changeset/base/248065

Log:
  User can specify the NULL value for the sigmask parameter.

Modified:
  user/dchagin/lemul/sys/compat/linux/linux_misc.c

Modified: user/dchagin/lemul/sys/compat/linux/linux_misc.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_misc.c	Fri Mar  8 19:02:45 2013	(r248064)
+++ user/dchagin/lemul/sys/compat/linux/linux_misc.c	Fri Mar  8 19:16:24 2013	(r248065)
@@ -2089,19 +2089,22 @@ linux_pselect6(struct thread *td, struct
 	sigset_t ss;
 	int error;
 
+	ssp = NULL;
 	if (args->sig) {
 		error = copyin(args->sig, &lpse6, sizeof(lpse6));
 		if (error)
 			return (error);
 		if (lpse6.ss_len != sizeof(l_ss))
 			return (EINVAL);
-		error = copyin(PTRIN(lpse6.ss), &l_ss, sizeof(l_ss));
-		if (error)
-			return (error);
-		linux_to_bsd_sigset(&l_ss, &ss);
-		ssp = &ss;
-	} else
-		ssp = NULL;
+		if (lpse6.ss != 0) {
+			error = copyin(PTRIN(lpse6.ss), &l_ss,
+			    sizeof(l_ss));
+			if (error)
+				return (error);
+			linux_to_bsd_sigset(&l_ss, &ss);
+			ssp = &ss;
+		}
+	}
 
 	/*
 	 * Currently glibc changes nanosecond number to microsecond.


More information about the svn-src-user mailing list