From 6e0526544a5492fd9744910f9800c6caf115044d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 11 Jun 2004 01:36:29 +0000 Subject: [PATCH] Now cuts off the path when it gives a team's main thread its name. Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7896 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/team.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/kernel/core/team.c b/src/kernel/core/team.c index 042b6f23fa..32d3a63442 100644 --- a/src/kernel/core/team.c +++ b/src/kernel/core/team.c @@ -598,11 +598,11 @@ team_id team_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority) { struct team *team, *parent; + const char *threadName; thread_id tid; team_id pid; int err; - unsigned int state; -// int sem_retcode; + cpu_status state; struct team_arg *teamArgs; TRACE(("team_create_team: entry '%s', name '%s' args = %p argc = %d\n", @@ -643,7 +643,7 @@ team_create_team(const char *path, const char *name, char **args, int argc, char // create a new io_context for this team team->io_context = vfs_new_io_context(thread_get_current_thread()->team->io_context); if (!team->io_context) { - err = ENOMEM; + err = B_NO_MEMORY; goto err3; } @@ -655,8 +655,15 @@ team_create_team(const char *path, const char *name, char **args, int argc, char } team->aspace = vm_get_aspace_by_id(team->_aspace_id); + // cut the path from the main thread name + threadName = strrchr(name, '/'); + if (threadName != NULL) + threadName++; + else + threadName = name; + // create a kernel thread, but under the context of the new team - tid = spawn_kernel_thread_etc(team_create_team2, name, B_NORMAL_PRIORITY, teamArgs, team->id); + tid = spawn_kernel_thread_etc(team_create_team2, threadName, B_NORMAL_PRIORITY, teamArgs, team->id); if (tid < 0) { err = tid; goto err5;