diff options
author | davidxu <davidxu@FreeBSD.org> | 2013-05-09 04:41:03 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2013-05-09 04:41:03 +0000 |
commit | bc7bbd0706d00129f3641efe9d28df411920dc86 (patch) | |
tree | e67e9883b0d3f8da3fd9ac17d356a31c7478b2d9 /lib/libthr/thread/thr_sig.c | |
parent | cdb158999f123266894664263bd1afb308bb65d0 (diff) | |
download | FreeBSD-src-bc7bbd0706d00129f3641efe9d28df411920dc86.zip FreeBSD-src-bc7bbd0706d00129f3641efe9d28df411920dc86.tar.gz |
Fix return value for setcontext and swapcontext.
Diffstat (limited to 'lib/libthr/thread/thr_sig.c')
-rw-r--r-- | lib/libthr/thread/thr_sig.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index e67bb6e..cb959a1 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -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 ucontext_t *ucp) { 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); |