strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2bd424
)
leak detective binds execution to a signle core, avoids corruption on SMP machines
author
Martin Willi
<martin@strongswan.org>
Fri, 12 Dec 2008 09:10:52 +0000
(09:10 -0000)
committer
Martin Willi
<martin@strongswan.org>
Fri, 12 Dec 2008 09:10:52 +0000
(09:10 -0000)
src/libstrongswan/utils/leak_detective.c
patch
|
blob
|
history
diff --git
a/src/libstrongswan/utils/leak_detective.c
b/src/libstrongswan/utils/leak_detective.c
index
abb470f
..
63d1635
100644
(file)
--- a/
src/libstrongswan/utils/leak_detective.c
+++ b/
src/libstrongswan/utils/leak_detective.c
@@
-15,6
+15,8
@@
* $Id$
*/
+#define _GNU_SOURCE
+#include <sched.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
@@
-473,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();
}