pthread_sigmask: fix return value to match POSIX

* signal.cc (handle_sigprocmask): Return error rather than setting
errno, for pthread_sigmask.
(sigprocmask): Adjust caller.
This commit is contained in:
Eric Blake 2011-07-10 00:01:33 +00:00
parent f6835aecb3
commit 14295a59d3
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2011-07-09 Eric Blake <eblake@redhat.com>
* signal.cc (handle_sigprocmask): Return error rather than setting
errno, for pthread_sigmask.
(sigprocmask): Adjust caller.
2011-07-07 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (yield): Drop thread priority only once.

View File

@ -174,7 +174,10 @@ usleep (useconds_t useconds)
extern "C" int
sigprocmask (int how, const sigset_t *set, sigset_t *oldset)
{
return handle_sigprocmask (how, set, oldset, _my_tls.sigmask);
int res = handle_sigprocmask (how, set, oldset, _my_tls.sigmask);
if (res)
set_errno (res);
return res ? -1 : 0;
}
int __stdcall
@ -184,13 +187,12 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op
if (how != SIG_BLOCK && how != SIG_UNBLOCK && how != SIG_SETMASK)
{
syscall_printf ("Invalid how value %d", how);
set_errno (EINVAL);
return -1;
return EINVAL;
}
myfault efault;
if (efault.faulted (EFAULT))
return -1;
return EFAULT;
if (oldset)
*oldset = opmask;