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
This commit is contained in:
parent
4f952f6c3a
commit
77a6e0beb6
@ -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...
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user