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
This commit is contained in:
+11
-4
@@ -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)
|
team_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority)
|
||||||
{
|
{
|
||||||
struct team *team, *parent;
|
struct team *team, *parent;
|
||||||
|
const char *threadName;
|
||||||
thread_id tid;
|
thread_id tid;
|
||||||
team_id pid;
|
team_id pid;
|
||||||
int err;
|
int err;
|
||||||
unsigned int state;
|
cpu_status state;
|
||||||
// int sem_retcode;
|
|
||||||
struct team_arg *teamArgs;
|
struct team_arg *teamArgs;
|
||||||
|
|
||||||
TRACE(("team_create_team: entry '%s', name '%s' args = %p argc = %d\n",
|
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
|
// create a new io_context for this team
|
||||||
team->io_context = vfs_new_io_context(thread_get_current_thread()->team->io_context);
|
team->io_context = vfs_new_io_context(thread_get_current_thread()->team->io_context);
|
||||||
if (!team->io_context) {
|
if (!team->io_context) {
|
||||||
err = ENOMEM;
|
err = B_NO_MEMORY;
|
||||||
goto err3;
|
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);
|
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
|
// 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) {
|
if (tid < 0) {
|
||||||
err = tid;
|
err = tid;
|
||||||
goto err5;
|
goto err5;
|
||||||
|
|||||||
Reference in New Issue
Block a user