svn commit: r219202 - stable/8/sys/compat/linux
Dmitry Chagin
dchagin at FreeBSD.org
Wed Mar 2 20:01:24 UTC 2011
Author: dchagin
Date: Wed Mar 2 20:01:24 2011
New Revision: 219202
URL: http://svn.freebsd.org/changeset/base/219202
Log:
MFC r218719 (by hand, depends on r209592):
Make a linux_rt_sigtimedwait() system call is actually working.
1) Translate the native signal number in the appropriate Linux signal.
2) Remove bogus code, which can lead to a panic as it calls
kern_sigtimedwait with the same ksiginfo.
3) Return the corresponding signal number.
Modified:
stable/8/sys/compat/linux/linux_signal.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c Wed Mar 2 19:49:37 2011 (r219201)
+++ stable/8/sys/compat/linux/linux_signal.c Wed Mar 2 20:01:24 2011 (r219202)
@@ -431,7 +431,7 @@ int
linux_rt_sigtimedwait(struct thread *td,
struct linux_rt_sigtimedwait_args *args)
{
- int error;
+ int error, sig;
l_timeval ltv;
struct timeval tv;
struct timespec ts, *tsa;
@@ -495,19 +495,15 @@ linux_rt_sigtimedwait(struct thread *td,
if (error)
return (error);
+ sig = BSD_TO_LINUX_SIGNAL(info.ksi_signo);
+
if (args->ptr) {
memset(&linfo, 0, sizeof(linfo));
- linfo.lsi_signo = info.ksi_signo;
+ ksiginfo_to_lsiginfo(&info, &linfo, sig);
error = copyout(&linfo, args->ptr, sizeof(linfo));
}
-
- /* Repost if we got an error. */
- if (error && info.ksi_signo) {
- PROC_LOCK(td->td_proc);
- tdsignal(td->td_proc, td, info.ksi_signo, &info);
- PROC_UNLOCK(td->td_proc);
- } else
- td->td_retval[0] = info.ksi_signo;
+ if (error == 0)
+ td->td_retval[0] = sig;
return (error);
}
@@ -590,7 +586,7 @@ linux_do_tkill(struct thread *td, l_int
ksi.ksi_pid = proc->p_pid;
ksi.ksi_uid = proc->p_ucred->cr_ruid;
- error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
+ error = pksignal(p, ksi.ksi_signo, &ksi);
out:
PROC_UNLOCK(p);
More information about the svn-src-stable-8
mailing list