diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-02-28 22:02:31 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-02-28 22:02:31 +0000 |
commit | 19364e11c66714324bd3d5d0dc9212db397085cb (patch) | |
tree | fe7f5e55f0474dad1d0c29ba7c0a6f4546c99c3a /src/libstrongswan/utils/leak_detective.c | |
parent | c7f1b0530b85bc7654e68992f25ed8ced5d0a80d (diff) | |
download | vyos-strongswan-19364e11c66714324bd3d5d0dc9212db397085cb.tar.gz vyos-strongswan-19364e11c66714324bd3d5d0dc9212db397085cb.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.12)
Diffstat (limited to 'src/libstrongswan/utils/leak_detective.c')
-rw-r--r-- | src/libstrongswan/utils/leak_detective.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index 73409158d..4c56c9596 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -12,9 +12,11 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * $Id: leak_detective.c 4609 2008-11-10 16:44:27Z martin $ + * $Id: leak_detective.c 4796 2008-12-12 09:10:52Z martin $ */ +#define _GNU_SOURCE +#include <sched.h> #include <stddef.h> #include <string.h> #include <stdio.h> @@ -160,6 +162,7 @@ char *whitelist[] = { /* pthread stuff */ "pthread_create", "pthread_setspecific", + "__pthread_setspecific", /* glibc functions */ "mktime", "__gmtime_r", @@ -199,6 +202,7 @@ char *whitelist[] = { "RSA_new_method", "DH_new_method", "ENGINE_load_builtin_engines", + "OPENSSL_config", }; /** @@ -471,6 +475,16 @@ leak_detective_t *leak_detective_create() if (getenv("LEAK_DETECTIVE_DISABLE") == NULL) { + cpu_set_t mask; + + CPU_ZERO(&mask); + CPU_SET(0, &mask); + + if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) != 0) + { + fprintf(stderr, "setting CPU affinity failed: %m"); + } + lib->leak_detective = TRUE; install_hooks(); } |