Author: axeld Date: 2010-04-13 15:29:56 +0200 (Tue, 13 Apr 2010) New Revision: 36215 Changeset: http://dev.haiku-os.org/changeset/36215/haiku Ticket: http://dev.haiku-os.org/ticket/5713 Modified: haiku/trunk/src/system/kernel/team.cpp Log: * Set the exit status for the main thread as well in _user_exit_team(). * This closes bug #5713. Modified: haiku/trunk/src/system/kernel/team.cpp =================================================================== --- haiku/trunk/src/system/kernel/team.cpp 2010-04-13 13:19:49 UTC (rev 36214) +++ haiku/trunk/src/system/kernel/team.cpp 2010-04-13 13:29:56 UTC (rev 36215) @@ -3496,10 +3496,17 @@ _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); }