Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block: Keep RTMIN through RTMAX signals blocked in child #454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions block.c
Expand Up @@ -234,12 +234,16 @@ static int block_child_sig(struct block *block)
{
sigset_t set;
int err;
unsigned int i;

/* It'd be safe to assume that all signals are unblocked by default */
err = sys_sigfillset(&set);
if (err)
return err;

for (i = 0; i <= SIGRTMAX - SIGRTMIN; i++)
sys_sigdelset(&set, SIGRTMIN + i);

return sys_sigunblock(&set);
}

Expand Down
14 changes: 14 additions & 0 deletions sys.c
Expand Up @@ -203,6 +203,20 @@ int sys_sigaddset(sigset_t *set, int sig)
return 0;
}

int sys_sigdelset(sigset_t *set, int sig)
{
int rc;

rc = sigdelset(set, sig);
if (rc == -1) {
sys_errno("sigdelset(%d (%s))", sig, strsignal(sig));
rc = -errno;
return rc;
}

return 0;
}

static int sys_sigprocmask(const sigset_t *set, int how)
{
int rc;
Expand Down
1 change: 1 addition & 0 deletions sys.h
Expand Up @@ -38,6 +38,7 @@ const char *sys_getenv(const char *name);
int sys_sigemptyset(sigset_t *set);
int sys_sigfillset(sigset_t *set);
int sys_sigaddset(sigset_t *set, int sig);
int sys_sigdelset(sigset_t *set, int sig);
int sys_sigunblock(const sigset_t *set);
int sys_sigsetmask(const sigset_t *set);
int sys_sigwaitinfo(sigset_t *set, int *sig, int *fd);
Expand Down