mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Fix to fork return value issue.
Mistakenly returned child pid to pager in thread_create. This is fixed. Its not the pager but the forking task that needs this value.
This commit is contained in:
@@ -139,7 +139,6 @@ int thread_create(struct task_ids *ids, unsigned int flags)
|
||||
{
|
||||
struct ktcb *task, *new = (struct ktcb *)zalloc_page();
|
||||
flags &= THREAD_FLAGS_MASK;
|
||||
int ret = 0;
|
||||
|
||||
if (flags == THREAD_CREATE_NEWSPC) {
|
||||
/* Allocate new pgd and copy all kernel areas */
|
||||
@@ -193,15 +192,13 @@ out:
|
||||
* system call return environment so that it can safely
|
||||
* return as a copy of its original thread.
|
||||
*/
|
||||
if (flags == THREAD_CREATE_COPYSPC) {
|
||||
if (flags == THREAD_CREATE_COPYSPC)
|
||||
arch_setup_new_thread(new, task);
|
||||
ret = new->tid;
|
||||
}
|
||||
|
||||
/* Add task to global hlist of tasks */
|
||||
add_task_global(new);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user