From fe6ff968b06b317869ddf0779eb30ae7a1610f20 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 25 Jan 2012 20:20:07 +0000 Subject: [PATCH] -quiet exit helper --- src/exit/gnunet-helper-exit.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/exit/gnunet-helper-exit.c b/src/exit/gnunet-helper-exit.c index db1401e89..9a7445d93 100644 --- a/src/exit/gnunet-helper-exit.c +++ b/src/exit/gnunet-helper-exit.c @@ -54,6 +54,12 @@ */ #include "gnunet_protocols.h" +/** + * Should we print (interesting|debug) messages that can happen during + * normal operation? + */ +#define DEBUG GNUNET_NO + /** * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE) */ @@ -476,7 +482,9 @@ run (int fd_tun) } else if (0 == buftun_size) { +#if DEBUG fprintf (stderr, "EOF on tun\n"); +#endif shutdown (fd_tun, SHUT_RD); shutdown (1, SHUT_WR); read_open = 0; @@ -498,7 +506,10 @@ run (int fd_tun) if (-1 == written) { - fprintf (stderr, "write-error to stdout: %s\n", strerror (errno)); +#if !DEBUG + if (errno != EPIPE) +#endif + fprintf (stderr, "write-error to stdout: %s\n", strerror (errno)); shutdown (fd_tun, SHUT_RD); shutdown (1, SHUT_WR); read_open = 0; @@ -529,7 +540,9 @@ run (int fd_tun) } else if (0 == bufin_size) { +#if DEBUG fprintf (stderr, "EOF on stdin\n"); +#endif shutdown (0, SHUT_RD); shutdown (fd_tun, SHUT_WR); write_open = 0; -- 2.25.1