fork() now also sets the __main_thread_id variable to match the new thread ID.
This fixes the "setpgrp() failed in child" message in gdb (that happened because it lied and called setpgid() instead). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12246 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -21,6 +21,8 @@ static fork_hook *sPrepareHooks, *sParentHooks, *sChildHooks;
|
||||
static fork_hook *sLastParentHook, *sLastChildHook;
|
||||
static sem_id sForkLock;
|
||||
|
||||
extern thread_id __main_thread_id;
|
||||
|
||||
|
||||
/** Adds a hook to the specified list.
|
||||
* If \a _lastHook is NULL, the hook will be added at the head of the list,
|
||||
@@ -149,7 +151,9 @@ fork(void)
|
||||
if (thread == 0) {
|
||||
// we are the child
|
||||
// ToDo: initialize child
|
||||
__main_thread_id = find_thread(NULL);
|
||||
__init_fork();
|
||||
|
||||
call_fork_hooks(sChildHooks);
|
||||
} else {
|
||||
// we are the parent
|
||||
|
||||
Reference in New Issue
Block a user