1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Optimize sigrelse 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>
This commit is contained in:
Adhemerval Zanella
2017-11-06 09:31:37 -02:00
parent ad4f43a234
commit 1ba1d8a44d
2 changed files with 5 additions and 9 deletions

View File

@ -26,14 +26,8 @@ sigrelse (int sig)
{
sigset_t set;
/* Retrieve current signal set. */
if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
sigemptyset (&set);
if (sigaddset (&set, sig) < 0)
return -1;
/* Remove the specified signal. */
if (sigdelset (&set, sig) < 0)
return -1;
/* Set the new mask. */
return __sigprocmask (SIG_SETMASK, &set, NULL);
return __sigprocmask (SIG_UNBLOCK, &set, NULL);
}