summaryrefslogtreecommitdiff
path: root/common/mock.c
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2014-10-03 09:42:27 +0200
committerStef Walter <stefw@redhat.com>2014-10-03 20:56:16 +0200
commit16e25b2890927108ec15297aabb1d86a49792741 (patch)
tree495215b96e664348fa6651696d517b22215d8467 /common/mock.c
parenta3b1e1c2f2c8c1f14293d8158b6dfeb2a6560908 (diff)
downloadp11-kit-16e25b2890927108ec15297aabb1d86a49792741.tar.gz
p11-kit: Use pthread_atfork() in a safe manner
Instead of trying to perform actions in pthread_atfork() which are not async-signal-safe, just increment a counter so we can later tell if the process has forked. Note this does not make it safe to mix threads and forking without immediately execing. This is a far broader problem that p11-kit, however we now do the right thing when fork+exec is used from a thread. https://bugs.freedesktop.org/show_bug.cgi?id=84567
Diffstat (limited to 'common/mock.c')
-rw-r--r--common/mock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/mock.c b/common/mock.c
index 01e095d..a73ae9d 100644
--- a/common/mock.c
+++ b/common/mock.c
@@ -46,6 +46,7 @@
#include "debug.h"
#include "dict.h"
#include "array.h"
+#include "library.h"
#include <assert.h>
#include <ctype.h>