aboutsummaryrefslogtreecommitdiff
path: root/stdlib/abort.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/abort.c')
-rw-r--r--stdlib/abort.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/stdlib/abort.c b/stdlib/abort.c
index caa9e6d..904244a 100644
--- a/stdlib/abort.c
+++ b/stdlib/abort.c
@@ -19,6 +19,7 @@
#include <internal-signals.h>
#include <libc-lock.h>
#include <pthreadP.h>
+#include <string.h>
#include <unistd.h>
/* Try to get a machine dependent instruction which will make the
@@ -42,7 +43,10 @@ __libc_rwlock_define_initialized (static, lock);
void
__abort_fork_reset_child (void)
{
- __libc_rwlock_init (lock);
+ /* Reinitialize lock without calling pthread_rwlock_init, to
+ avoid a valgrind DRD false positive. */
+ __libc_rwlock_define_initialized (, reset_lock);
+ memcpy (&lock, &reset_lock, sizeof (lock));
}
void