summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-01-09 16:29:51 +0000
committerdchagin <dchagin@FreeBSD.org>2016-01-09 16:29:51 +0000
commitf31e70952fa696f99ce03554a8e4e1a7a7a96931 (patch)
treeae7618105772a4b88096be61ff40c9ea82c86ea3
parentcda33c12b343f1c255629b1f7611655e3b29e3ac (diff)
downloadFreeBSD-src-f31e70952fa696f99ce03554a8e4e1a7a7a96931.zip
FreeBSD-src-f31e70952fa696f99ce03554a8e4e1a7a7a96931.tar.gz
MFC r283436:
Use the BSD_TO_LINUX_SIGNAL() wherever there is no need to check the ABI as it is known.
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c8
-rw-r--r--sys/compat/linux/linux_signal.c11
-rw-r--r--sys/i386/linux/linux_sysvec.c8
3 files changed, 7 insertions, 20 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 448563b..bf570c7 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -344,9 +344,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = BSD_TO_LINUX_SIGNAL(sig);
bzero(&frame, sizeof(frame));
@@ -492,9 +490,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = BSD_TO_LINUX_SIGNAL(sig);
bzero(&frame, sizeof(frame));
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index 462d015..856d433 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -628,10 +628,8 @@ linux_tkill(struct thread *td, struct linux_tkill_args *args)
if (!LINUX_SIG_VALID(args->sig))
return (EINVAL);
- if (args->sig > 0 && args->sig <= LINUX_SIGTBLSZ)
- sig = linux_to_bsd_signal[_SIG_IDX(args->sig)];
- else
- sig = args->sig;
+
+ sig = BSD_TO_LINUX_SIGNAL(args->sig);
tdt = linux_tdfind(td, args->tid, -1);
if (tdt == NULL)
@@ -788,10 +786,7 @@ linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args
if (linfo.lsi_code >= 0)
return (EPERM);
- if (args->sig > 0 && args->sig <= LINUX_SIGTBLSZ)
- sig = linux_to_bsd_signal[_SIG_IDX(args->sig)];
- else
- sig = args->sig;
+ sig = BSD_TO_LINUX_SIGNAL(args->sig);
error = ESRCH;
if ((p = pfind(args->pid)) != NULL ||
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index c1dca1d..f27fad8 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -480,9 +480,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = BSD_TO_LINUX_SIGNAL(sig);
bzero(&frame, sizeof(frame));
@@ -623,9 +621,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = BSD_TO_LINUX_SIGNAL(sig);
bzero(&frame, sizeof(frame));
OpenPOWER on IntegriCloud