aboutsummaryrefslogtreecommitdiff
path: root/src/orphanage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/orphanage.c')
-rw-r--r--src/orphanage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/orphanage.c b/src/orphanage.c
index 526affc..797468d 100644
--- a/src/orphanage.c
+++ b/src/orphanage.c
@@ -29,16 +29,16 @@ void unorphanize(struct tcb *t)
/* attach to init process */
struct tcb *init = get_tcb(1);
- reference_proc(init);
+ reference_thread(init);
+
+ free_stack(t);
+ reset_rpc_stack(t);
id_t old_rid = t->rid;
t->rid = 1;
t->pid = 1;
t->eid = 1;
- free_stack(t);
- reset_rpc_stack(t);
-
t->proc = init->proc;
use_vmem(t->proc.vmem);
alloc_stack(t);