oldSet shouldn't be changed in case of error. Thanks axel for noticing
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18533 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -385,12 +385,7 @@ sigprocmask(int how, const sigset_t *set, sigset_t *oldSet)
|
|||||||
struct thread *thread = thread_get_current_thread();
|
struct thread *thread = thread_get_current_thread();
|
||||||
sigset_t oldMask = atomic_get(&thread->sig_block_mask);
|
sigset_t oldMask = atomic_get(&thread->sig_block_mask);
|
||||||
|
|
||||||
if (oldSet != NULL)
|
if (set != NULL) {
|
||||||
*oldSet = oldMask;
|
|
||||||
|
|
||||||
if (set == NULL)
|
|
||||||
return B_OK;
|
|
||||||
|
|
||||||
switch (how) {
|
switch (how) {
|
||||||
case SIG_BLOCK:
|
case SIG_BLOCK:
|
||||||
atomic_or(&thread->sig_block_mask, *set & BLOCKABLE_SIGNALS);
|
atomic_or(&thread->sig_block_mask, *set & BLOCKABLE_SIGNALS);
|
||||||
@@ -404,6 +399,10 @@ sigprocmask(int how, const sigset_t *set, sigset_t *oldSet)
|
|||||||
default:
|
default:
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oldSet != NULL)
|
||||||
|
*oldSet = oldMask;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user