From: Philipp Tölke Date: Tue, 20 Jul 2010 19:53:52 +0000 (+0000) Subject: restart the helper when something goes wrong X-Git-Tag: initial-import-from-subversion-38251~20888 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9315fa7ca773e561efaba508f1868c9412bb9884;p=oweals%2Fgnunet.git restart the helper when something goes wrong --- diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index e3ae2a16e..b003d7b53 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c @@ -92,8 +92,9 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts 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) { + if (t<=0) { fprintf(stderr, "Read error for header: %m\n"); + GNUNET_SCHEDULER_add_now(mycls->sched, restart_helper, cls); return; } r += t; @@ -108,8 +109,9 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts while (r < ntohl(pkt->hdr.size)) { int t = GNUNET_DISK_file_read(mycls->fh_from_helper, (unsigned char*)pkt + r, ntohl(pkt->hdr.size) - r); - if (t< 0) { + if (t<=0) { fprintf(stderr, "Read error for data: %m\n"); + GNUNET_SCHEDULER_add_now(mycls->sched, restart_helper, cls); return; } r += t;