Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 May 2013 04:41:03 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250402 - head/lib/libthr/thread
Message-ID:  <201305090441.r494f3Cv095825@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Thu May  9 04:41:03 2013
New Revision: 250402
URL: http://svnweb.freebsd.org/changeset/base/250402

Log:
  Fix return value for setcontext and swapcontext.

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Thu May  9 02:23:02 2013	(r250401)
+++ head/lib/libthr/thread/thr_sig.c	Thu May  9 04:41:03 2013	(r250402)
@@ -725,8 +725,10 @@ _setcontext(const ucontext_t *ucp)
 {
 	ucontext_t uc;
 
-	if (ucp == NULL)
-		return (EINVAL);
+	if (ucp == NULL) {
+		errno = EINVAL;
+		return (-1);
+	}
 	if (!SIGISMEMBER(uc.uc_sigmask, SIGCANCEL))
 		return __sys_setcontext(ucp);
 	(void) memcpy(&uc, ucp, sizeof(uc));
@@ -740,8 +742,10 @@ _swapcontext(ucontext_t *oucp, const uco
 {
 	ucontext_t uc;
 
-	if (oucp == NULL || ucp == NULL)
-		return (EINVAL);
+	if (oucp == NULL || ucp == NULL) {
+		errno = EINVAL;
+		return (-1);
+	}
 	if (SIGISMEMBER(ucp->uc_sigmask, SIGCANCEL)) {
 		(void) memcpy(&uc, ucp, sizeof(uc));
 		SIGDELSET(uc.uc_sigmask, SIGCANCEL);



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