From: Philipp Tölke Date: Tue, 20 Jul 2010 08:20:39 +0000 (+0000) Subject: CG could answer my questions X-Git-Tag: initial-import-from-subversion-38251~20914 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cf2b5b068fe12986ebe4c21a2ce1fa04f5881c55;p=oweals%2Fgnunet.git CG could answer my questions --- 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 { struct GNUNET_DISK_PipeHandle* helper_out; const struct GNUNET_DISK_FileHandle* fh_from_helper; - struct GNUNET_SCHEDULER_Handle *sched; // TODO CG: is that right? Do I have to carry it around myself? + struct GNUNET_SCHEDULER_Handle *sched; pid_t helper_pid; }; static void cleanup(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) { struct vpn_cls* mycls = (struct vpn_cls*) cls; - if (tskctx->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) { + if (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) { PLIBC_KILL(mycls->helper_pid, SIGTERM); GNUNET_OS_process_wait(mycls->helper_pid); } @@ -59,6 +59,9 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts int r = 0; + if (tsdkctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) + return; + while (r < sizeof(struct suid_packet_header)) { int t = GNUNET_DISK_file_read(mycls->fh_from_helper, &hdr, sizeof(struct suid_packet_header)); if (t< 0) {