From 616fb065b215ed8e98faf5acd60cb1403fe03e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 5 Apr 2005 12:36:00 +0000 Subject: [PATCH] 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 --- src/kernel/libroot/posix/unistd/fork.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kernel/libroot/posix/unistd/fork.c b/src/kernel/libroot/posix/unistd/fork.c index d33f0d431e..ee735dca7a 100644 --- a/src/kernel/libroot/posix/unistd/fork.c +++ b/src/kernel/libroot/posix/unistd/fork.c @@ -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