diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-12-17 15:58:12 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-12-23 17:03:41 +0100 |
commit | 4a5a5dd2900ed3b58381854e2c04ef23cd105645 (patch) | |
tree | 7f6b58cb8e1959731f8cb22746064ad2659260c3 /src/charon/plugins/kernel_klips/kernel_klips_ipsec.c | |
parent | c48eea920334488eb4fcc208cc0ba68b6989c045 (diff) | |
download | strongswan-4a5a5dd2900ed3b58381854e2c04ef23cd105645.tar.bz2 strongswan-4a5a5dd2900ed3b58381854e2c04ef23cd105645.tar.xz |
Using the thread wrapper in charon, libstrongswan and their plugins.
Diffstat (limited to 'src/charon/plugins/kernel_klips/kernel_klips_ipsec.c')
-rw-r--r-- | src/charon/plugins/kernel_klips/kernel_klips_ipsec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/charon/plugins/kernel_klips/kernel_klips_ipsec.c b/src/charon/plugins/kernel_klips/kernel_klips_ipsec.c index 29a77de8b..c4adc2413 100644 --- a/src/charon/plugins/kernel_klips/kernel_klips_ipsec.c +++ b/src/charon/plugins/kernel_klips/kernel_klips_ipsec.c @@ -21,7 +21,6 @@ #include <linux/udp.h> #include <net/if.h> #include <unistd.h> -#include <pthread.h> #include <stdio.h> #include <string.h> #include <time.h> @@ -30,6 +29,7 @@ #include "kernel_klips_ipsec.h" #include <daemon.h> +#include <threading/thread.h> #include <threading/mutex.h> #include <processing/jobs/callback_job.h> #include <processing/jobs/acquire_job.h> @@ -1375,11 +1375,12 @@ static job_requeue_t receive_events(private_kernel_klips_ipsec_t *this) { unsigned char buf[PFKEY_BUFFER_SIZE]; struct sadb_msg *msg = (struct sadb_msg*)buf; - int len, oldstate; + int len; + bool oldstate; - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate); + oldstate = thread_cancelability(TRUE); len = recv(this->socket_events, buf, sizeof(buf), 0); - pthread_setcancelstate(oldstate, NULL); + thread_cancelability(oldstate); if (len < 0) { |