From da329fc01237545c8f5678497a2ffb8409dd3ba4 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 6 Dec 2011 01:53:27 +0100 Subject: [PATCH] Add missing asignment of return code in wait_for_thread_etc(). While it was detected that the thread is in the destruction phase and that it was necessary to wait and then have a valid status code in the death entry, that status code wasn't actually returned. This lead to uninitialized values for the return code even though wait_for_thread[_etc]() would return B_OK. --- src/system/kernel/thread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index a786609043..43e69d3350 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -2563,6 +2563,9 @@ wait_for_thread_etc(thread_id id, uint32 flags, bigtime_t timeout, // middle of the cleanup. acquire_sem(exitSem); status = B_OK; + + if (_returnCode != NULL) + *_returnCode = death.status; } }