Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Fix build warning of initialization but no use.
Browse files Browse the repository at this point in the history
first_run is only used with LOCK_AT_FORK, however, care needs to be
taken with the #if to avoid compiler warnings when LOCK_AT_FORK isn't
being used.

Change-Id: I6bcfac2ab8732c91607f4a1bcd7c0019f29c2eec
  • Loading branch information
captain5050 committed Sep 6, 2012
1 parent ff4608a commit 09f76cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libc/upstream-dlmalloc/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3193,11 +3193,11 @@ static int init_mparams(void) {

RELEASE_MALLOC_GLOBAL_LOCK();
/* BEGIN android-added: move pthread_atfork outside of lock */
#if LOCK_AT_FORK
if (first_run != 0) {
#if LOCK_AT_FORK
pthread_atfork(&pre_fork, &post_fork_parent, &post_fork_child);
}
#endif
}
/* END android-added */
return 1;
}
Expand Down

0 comments on commit 09f76cd

Please sign in to comment.