diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-07-09 01:06:12 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-07-09 01:06:12 +0000 |
commit | 54fcf3f7fa7dd7e6d9508acfae3e606bf9a536a8 (patch) | |
tree | 26c6de1f517e656066410bf1d0337da5c426d81a /lib | |
parent | 28f4067fe0887b4870b0ec63b897ff1fa41e4602 (diff) | |
download | FreeBSD-src-54fcf3f7fa7dd7e6d9508acfae3e606bf9a536a8.zip FreeBSD-src-54fcf3f7fa7dd7e6d9508acfae3e606bf9a536a8.tar.gz |
Save and restore thread's error code around signal handling.
Reviewed by: deischen
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/thread/thr_kern.c | 3 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c index d2567b7..717a766 100644 --- a/lib/libkse/thread/thr_kern.c +++ b/lib/libkse/thread/thr_kern.c @@ -1036,7 +1036,7 @@ thr_resume_wrapper(int sig, siginfo_t *siginfo, ucontext_t *ucp) { struct pthread *curthread = _get_curthread(); struct kse *curkse; - int ret; + int ret, err_save = curthread->error; DBG_MSG(">>> sig wrapper\n"); if (curthread->lock_switch) @@ -1045,6 +1045,7 @@ thr_resume_wrapper(int sig, siginfo_t *siginfo, ucontext_t *ucp) _kse_critical_enter(); curkse = _get_curkse(); curthread->tmbx.tm_context = *ucp; + curthread->error = err_save; ret = _thread_switch(&curthread->tmbx, &curkse->k_mbx.km_curthread); if (ret != 0) PANIC("thr_resume_wrapper: thread has returned " diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index d2567b7..717a766 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -1036,7 +1036,7 @@ thr_resume_wrapper(int sig, siginfo_t *siginfo, ucontext_t *ucp) { struct pthread *curthread = _get_curthread(); struct kse *curkse; - int ret; + int ret, err_save = curthread->error; DBG_MSG(">>> sig wrapper\n"); if (curthread->lock_switch) @@ -1045,6 +1045,7 @@ thr_resume_wrapper(int sig, siginfo_t *siginfo, ucontext_t *ucp) _kse_critical_enter(); curkse = _get_curkse(); curthread->tmbx.tm_context = *ucp; + curthread->error = err_save; ret = _thread_switch(&curthread->tmbx, &curkse->k_mbx.km_curthread); if (ret != 0) PANIC("thr_resume_wrapper: thread has returned " |