summaryrefslogtreecommitdiffstats
path: root/src/lib9/ffork-pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9/ffork-pthread.c')
-rw-r--r--src/lib9/ffork-pthread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib9/ffork-pthread.c b/src/lib9/ffork-pthread.c
index ff61ed10..24b987b3 100644
--- a/src/lib9/ffork-pthread.c
+++ b/src/lib9/ffork-pthread.c
@@ -14,8 +14,11 @@ ffork(int flags, void(*fn)(void*), void *arg)
return -1;
}
+ _p9uproc(0);
if(pthread_create(&tid, NULL, (void*(*)(void*))fn, arg) < 0)
return -1;
+ if((int)tid == 0)
+ _p9uproc(0);
return (int)tid;
}