From: Ivan Maidanski Date: Mon, 20 Feb 2012 17:58:21 +0000 (+0400) Subject: Check pthread_atfork result (POSIX threads) X-Git-Tag: gc7_2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0e3b0d8444fcae8dbe6a4927f5dc626df81e0e9;p=gc Check pthread_atfork result (POSIX threads) * pthread_support.c (GC_thr_init): Abort on pthread_atfork failure (only if HANDLE_FORK). --- diff --git a/pthread_support.c b/pthread_support.c index 35c17712..26ef6e2d 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 */