From 77a6e0beb66716403465fd5c1aa96c7e77cf23ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 20 Nov 2004 22:05:50 +0000 Subject: [PATCH] exec_team() now renames its main thread to the new program name. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10061 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/team.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/kernel/core/team.c b/src/kernel/core/team.c index fbee074316..1139ab6b05 100644 --- a/src/kernel/core/team.c +++ b/src/kernel/core/team.c @@ -1034,6 +1034,7 @@ exec_team(int32 argCount, char **args, int32 envCount, char **env) { struct team *team = thread_get_current_thread()->team; struct team_arg *teamArgs; + const char *threadName; status_t status; TRACE(("exec_team(path = \"%s\", argc = %ld, envCount = %ld)\n", args[0], argCount, envCount)); @@ -1066,6 +1067,14 @@ exec_team(int32 argCount, char **args, int32 envCount, char **env) remove_images(team); vfs_exec_io_context(team->io_context); + // cut the path from the main thread name + threadName = strrchr(args[0], '/'); + if (threadName != NULL) + threadName++; + else + threadName = args[0]; + rename_thread(thread_get_current_thread_id(), threadName); + status = team_create_thread_start(teamArgs); // this one usually doesn't return...