From fefe246c70050f3bac9585a2c0875a508c33a0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 13 Apr 2010 13:29:56 +0000 Subject: [PATCH] * Set the exit status for the main thread as well in _user_exit_team(). * This closes bug #5713. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36215 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/team.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index 9db7e0f2ee..0e7b271f1e 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -3496,9 +3496,16 @@ void _user_exit_team(status_t returnValue) { struct thread* thread = thread_get_current_thread(); + struct thread* mainThread = thread->team->main_thread; - thread->exit.status = returnValue; - thread->exit.reason = THREAD_RETURN_EXIT; + mainThread->exit.status = returnValue; + mainThread->exit.reason = THREAD_RETURN_EXIT; + + // Also set the exit code in the current thread for the sake of it + if (thread != mainThread) { + thread->exit.status = returnValue; + thread->exit.reason = THREAD_RETURN_EXIT; + } send_signal(thread->id, SIGKILL); }