projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
x86_64: ensure that dtor pointer passed to app is 0 so it won't be used
[musl]
/
src
/
process
/
fork.c
diff --git
a/src/process/fork.c
b/src/process/fork.c
index
bcd47c9
..
a04e892
100644
(file)
--- a/
src/process/fork.c
+++ b/
src/process/fork.c
@@
-8,10
+8,11
@@
pid_t fork(void)
pid_t ret;
if (libc.fork_handler) libc.fork_handler(-1);
ret = syscall(SYS_fork);
pid_t ret;
if (libc.fork_handler) libc.fork_handler(-1);
ret = syscall(SYS_fork);
- if (libc.
threade
d && !ret) {
+ if (libc.
main_threa
d && !ret) {
pthread_t self = __pthread_self();
self->tid = self->pid = syscall(SYS_getpid);
libc.threads_minus_1 = 0;
pthread_t self = __pthread_self();
self->tid = self->pid = syscall(SYS_getpid);
libc.threads_minus_1 = 0;
+ libc.main_thread = self;
}
if (libc.fork_handler) libc.fork_handler(!ret);
return ret;
}
if (libc.fork_handler) libc.fork_handler(!ret);
return ret;