-quiet exit helper
authorChristian Grothoff <christian@grothoff.org>
Wed, 25 Jan 2012 20:20:07 +0000 (20:20 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 25 Jan 2012 20:20:07 +0000 (20:20 +0000)
src/exit/gnunet-helper-exit.c

index db1401e89944a838b8fa207dc6c2e4739642898a..9a7445d936afe1a5241a41a8f95dd66fe32b27e2 100644 (file)
  */
 #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;