aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2010-07-20 08:20:39 +0000
committerPhilipp Tölke <toelke@in.tum.de>2010-07-20 08:20:39 +0000
commitcf2b5b068fe12986ebe4c21a2ce1fa04f5881c55 (patch)
tree9d15af729a2797376d532eae9b14cee1055aeb61 /src/vpn
parent755b73c213813659c1b1e1f06dad895710bca3ad (diff)
downloadgnunet-cf2b5b068fe12986ebe4c21a2ce1fa04f5881c55.tar.gz
gnunet-cf2b5b068fe12986ebe4c21a2ce1fa04f5881c55.zip
CG could answer my questions
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index 875ebf018..5cc832127 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -40,14 +40,14 @@ struct vpn_cls {
40 struct GNUNET_DISK_PipeHandle* helper_out; 40 struct GNUNET_DISK_PipeHandle* helper_out;
41 const struct GNUNET_DISK_FileHandle* fh_from_helper; 41 const struct GNUNET_DISK_FileHandle* fh_from_helper;
42 42
43 struct GNUNET_SCHEDULER_Handle *sched; // TODO CG: is that right? Do I have to carry it around myself? 43 struct GNUNET_SCHEDULER_Handle *sched;
44 44
45 pid_t helper_pid; 45 pid_t helper_pid;
46}; 46};
47 47
48static void cleanup(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) { 48static void cleanup(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) {
49 struct vpn_cls* mycls = (struct vpn_cls*) cls; 49 struct vpn_cls* mycls = (struct vpn_cls*) cls;
50 if (tskctx->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) { 50 if (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) {
51 PLIBC_KILL(mycls->helper_pid, SIGTERM); 51 PLIBC_KILL(mycls->helper_pid, SIGTERM);
52 GNUNET_OS_process_wait(mycls->helper_pid); 52 GNUNET_OS_process_wait(mycls->helper_pid);
53 } 53 }
@@ -59,6 +59,9 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts
59 59
60 int r = 0; 60 int r = 0;
61 61
62 if (tsdkctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)
63 return;
64
62 while (r < sizeof(struct suid_packet_header)) { 65 while (r < sizeof(struct suid_packet_header)) {
63 int t = GNUNET_DISK_file_read(mycls->fh_from_helper, &hdr, sizeof(struct suid_packet_header)); 66 int t = GNUNET_DISK_file_read(mycls->fh_from_helper, &hdr, sizeof(struct suid_packet_header));
64 if (t< 0) { 67 if (t< 0) {