diff options
author | dchagin <dchagin@FreeBSD.org> | 2011-02-15 21:42:48 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2011-02-15 21:42:48 +0000 |
commit | 77c093e6c2726cd9a391b9d1b470ade8b9f0bcb5 (patch) | |
tree | 4e1bbf6f078ba2fd035becd2fffa5c16dd3476ed /sys | |
parent | ee445bda8127c567af3da152d2d2a159d190c605 (diff) | |
download | FreeBSD-src-77c093e6c2726cd9a391b9d1b470ade8b9f0bcb5.zip FreeBSD-src-77c093e6c2726cd9a391b9d1b470ade8b9f0bcb5.tar.gz |
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 same ksiginfo.
3) Return the corresponding signal number.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linux/linux_signal.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 381fe1e..4a233c8 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -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); - tdksignal(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); } |