mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
Optimize sighold implementation
This patch simplifies sighold a bit by removing an extra sigprocmask and using SIG_BLOCK (which union of the current set and the set argument). Checked on x86_64-linux-gnu. * signal/sighold.c (sighold): Optimize implementation. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Zack Weinberg <zackw@panix.com>
This commit is contained in:
parent
6a4235f129
commit
d83da3a4ce
@ -1,5 +1,7 @@
|
||||
2017-11-06 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
|
||||
* signal/sighold.c (sighold): Optimize implementation.
|
||||
|
||||
* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
|
||||
__NR_rt_sigqueueinfo.
|
||||
|
||||
|
@ -26,14 +26,8 @@ sighold (int sig)
|
||||
{
|
||||
sigset_t set;
|
||||
|
||||
/* Retrieve current signal set. */
|
||||
if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
|
||||
return -1;
|
||||
|
||||
/* Add the specified signal. */
|
||||
sigemptyset (&set);
|
||||
if (sigaddset (&set, sig) < 0)
|
||||
return -1;
|
||||
|
||||
/* Set the new mask. */
|
||||
return __sigprocmask (SIG_SETMASK, &set, NULL);
|
||||
return __sigprocmask (SIG_BLOCK, &set, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user