mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-24 02:34:59 +00:00
Fix sigvec(). When the sigset_t changes came in, it was altered
to call osigaction(). But that's wrong because it causes the handler to receive a struct osigcontext instead of the expected struct sigcontext. Use sigaction() instead, copying the compatible portion of the signal mask. Reviewed by: marcel
This commit is contained in:
parent
ee774a4d62
commit
2bc2b29270
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52040
|
@ -47,14 +47,25 @@ sigvec(signo, sv, osv)
|
|||
int signo;
|
||||
struct sigvec *sv, *osv;
|
||||
{
|
||||
struct sigaction sa, osa;
|
||||
struct sigaction *sap, *osap;
|
||||
int ret;
|
||||
|
||||
if (sv)
|
||||
sv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */
|
||||
ret = osigaction(signo, (struct osigaction *)sv,
|
||||
(struct osigaction *)osv);
|
||||
if (ret == 0 && osv)
|
||||
osv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */
|
||||
if (sv != NULL) {
|
||||
sa.sa_handler = sv->sv_handler;
|
||||
sa.sa_flags = sv->sv_flags ^ SV_INTERRUPT;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_mask.__bits[0] = sv->sv_mask;
|
||||
sap = &sa;
|
||||
} else
|
||||
sap = NULL;
|
||||
osap = osv != NULL ? &osa : NULL;
|
||||
ret = sigaction(signo, sap, osap);
|
||||
if (ret == 0 && osv != NULL) {
|
||||
osv->sv_handler = osa.sa_handler;
|
||||
osv->sv_flags = osa.sa_flags ^ SV_INTERRUPT;
|
||||
osv->sv_mask = osa.sa_mask.__bits[0];
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue