diff options
-rwxr-xr-x | automaint.sh | 2 | ||||
-rw-r--r-- | build/Makefile.decl | 5 | ||||
-rw-r--r-- | build/Makefile.tests | 5 | ||||
-rw-r--r-- | common/compat.c | 2 | ||||
-rw-r--r-- | p11-kit/modules.c | 2 |
5 files changed, 13 insertions, 3 deletions
diff --git a/automaint.sh b/automaint.sh index 975556d..96cb60c 100755 --- a/automaint.sh +++ b/automaint.sh @@ -41,7 +41,7 @@ done echo ' done' done - for target in distcheck memcheck leakcheck install upload-coverage \ + for target in distcheck memcheck leakcheck hellcheck install upload-coverage \ coverage upload-doc upload-release transifex; do echo "$target:" echo ' $(MAKE) -C ./local' $target diff --git a/build/Makefile.decl b/build/Makefile.decl index c90c22b..8dca4e7 100644 --- a/build/Makefile.decl +++ b/build/Makefile.decl @@ -9,3 +9,8 @@ leakcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \ done + +hellcheck: + @for dir in $(SUBDIRS); do \ + test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \ + done diff --git a/build/Makefile.tests b/build/Makefile.tests index 3faa7f3..0c5b85c 100644 --- a/build/Makefile.tests +++ b/build/Makefile.tests @@ -12,8 +12,13 @@ MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet --trace-child LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes +HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind + memcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS leakcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS + +hellcheck: all + make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS diff --git a/common/compat.c b/common/compat.c index 4d8d73c..b8ed2ad 100644 --- a/common/compat.c +++ b/common/compat.c @@ -161,7 +161,7 @@ p11_mutex_init (p11_mutex_t *mutex) int ret; pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_DEFAULT); ret = pthread_mutex_init (mutex, &attr); assert (ret == 0); pthread_mutexattr_destroy (&attr); diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 19ba895..e62a43c 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -531,8 +531,8 @@ initialize_module_unlocked_reentrant (Module *mod) mod->initialize_thread = self; /* Change over to the module specific mutex */ - p11_mutex_lock (&mod->initialize_mutex); p11_unlock (); + p11_mutex_lock (&mod->initialize_mutex); if (!mod->initialize_called) { assert (mod->funcs); |