summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-02-20 18:58:21 +0100
committerIvan Maidanski <ivmai@mail.ru>2012-04-03 05:59:59 +0200
commita0e3b0d8444fcae8dbe6a4927f5dc626df81e0e9 (patch)
tree8870311031adc6e8a5bff616a91ad8c2fc12ebe5
parent424687f5f4d07322c02caebf493427954f7471ff (diff)
Check pthread_atfork result (POSIX threads)
* pthread_support.c (GC_thr_init): Abort on pthread_atfork failure (only if HANDLE_FORK).
-rw-r--r--pthread_support.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pthread_support.c b/pthread_support.c
index 35c1771..26ef6e2 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -958,8 +958,9 @@ GC_INNER void GC_thr_init(void)
# ifdef HANDLE_FORK
/* Prepare for a possible fork. */
- pthread_atfork(GC_fork_prepare_proc, GC_fork_parent_proc,
- GC_fork_child_proc);
+ if (pthread_atfork(GC_fork_prepare_proc, GC_fork_parent_proc,
+ GC_fork_child_proc) != 0)
+ ABORT("pthread_atfork failed");
# endif
# ifdef INCLUDE_LINUX_THREAD_DESCR
/* Explicitly register the region including the address */