diff options
Diffstat (limited to 'src/process/fork.c')
-rw-r--r-- | src/process/fork.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/process/fork.c b/src/process/fork.c index 1a82f428..864c7d7a 100644 --- a/src/process/fork.c +++ b/src/process/fork.c @@ -17,12 +17,11 @@ pid_t fork(void) __fork_handler(-1); __block_all_sigs(&set); ret = syscall(SYS_fork); - if (libc.main_thread && !ret) { + if (libc.has_thread_pointer && !ret) { pthread_t self = __pthread_self(); - self->tid = self->pid = syscall(SYS_getpid); + self->tid = self->pid = __syscall(SYS_getpid); memset(&self->robust_list, 0, sizeof self->robust_list); libc.threads_minus_1 = 0; - libc.main_thread = self; } __restore_sigs(&set); __fork_handler(!ret); |