diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-25 20:20:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-25 20:20:07 +0000 |
commit | fe6ff968b06b317869ddf0779eb30ae7a1610f20 (patch) | |
tree | f2322579e383c0a1d908560e72acd4d8bef0ebb1 /src/exit/gnunet-helper-exit.c | |
parent | f46035b9126e0bfe6521f2f3e7b66fa6e0bc93d3 (diff) | |
download | gnunet-fe6ff968b06b317869ddf0779eb30ae7a1610f20.tar.gz gnunet-fe6ff968b06b317869ddf0779eb30ae7a1610f20.zip |
-quiet exit helper
Diffstat (limited to 'src/exit/gnunet-helper-exit.c')
-rw-r--r-- | src/exit/gnunet-helper-exit.c | 15 |
1 files changed, 14 insertions, 1 deletions
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 | |||
@@ -55,6 +55,12 @@ | |||
55 | #include "gnunet_protocols.h" | 55 | #include "gnunet_protocols.h" |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Should we print (interesting|debug) messages that can happen during | ||
59 | * normal operation? | ||
60 | */ | ||
61 | #define DEBUG GNUNET_NO | ||
62 | |||
63 | /** | ||
58 | * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE) | 64 | * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE) |
59 | */ | 65 | */ |
60 | #define MAX_SIZE 65536 | 66 | #define MAX_SIZE 65536 |
@@ -476,7 +482,9 @@ run (int fd_tun) | |||
476 | } | 482 | } |
477 | else if (0 == buftun_size) | 483 | else if (0 == buftun_size) |
478 | { | 484 | { |
485 | #if DEBUG | ||
479 | fprintf (stderr, "EOF on tun\n"); | 486 | fprintf (stderr, "EOF on tun\n"); |
487 | #endif | ||
480 | shutdown (fd_tun, SHUT_RD); | 488 | shutdown (fd_tun, SHUT_RD); |
481 | shutdown (1, SHUT_WR); | 489 | shutdown (1, SHUT_WR); |
482 | read_open = 0; | 490 | read_open = 0; |
@@ -498,7 +506,10 @@ run (int fd_tun) | |||
498 | 506 | ||
499 | if (-1 == written) | 507 | if (-1 == written) |
500 | { | 508 | { |
501 | fprintf (stderr, "write-error to stdout: %s\n", strerror (errno)); | 509 | #if !DEBUG |
510 | if (errno != EPIPE) | ||
511 | #endif | ||
512 | fprintf (stderr, "write-error to stdout: %s\n", strerror (errno)); | ||
502 | shutdown (fd_tun, SHUT_RD); | 513 | shutdown (fd_tun, SHUT_RD); |
503 | shutdown (1, SHUT_WR); | 514 | shutdown (1, SHUT_WR); |
504 | read_open = 0; | 515 | read_open = 0; |
@@ -529,7 +540,9 @@ run (int fd_tun) | |||
529 | } | 540 | } |
530 | else if (0 == bufin_size) | 541 | else if (0 == bufin_size) |
531 | { | 542 | { |
543 | #if DEBUG | ||
532 | fprintf (stderr, "EOF on stdin\n"); | 544 | fprintf (stderr, "EOF on stdin\n"); |
545 | #endif | ||
533 | shutdown (0, SHUT_RD); | 546 | shutdown (0, SHUT_RD); |
534 | shutdown (fd_tun, SHUT_WR); | 547 | shutdown (fd_tun, SHUT_WR); |
535 | write_open = 0; | 548 | write_open = 0; |