aboutsummaryrefslogtreecommitdiff
path: root/src/dns/gnunet-helper-dns.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-03 22:51:14 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-03 22:51:14 +0000
commit0bc020d2fe8fa8aa1e6896cd38c7b9d6c2311267 (patch)
treec4e9795e36241788f438b6b14dfb3a3c74f962d6 /src/dns/gnunet-helper-dns.c
parent2b8b0b0dac4286b5f935167b57db5255eab1681f (diff)
downloadgnunet-0bc020d2fe8fa8aa1e6896cd38c7b9d6c2311267.tar.gz
gnunet-0bc020d2fe8fa8aa1e6896cd38c7b9d6c2311267.zip
-misc DNS related bugfixes
Diffstat (limited to 'src/dns/gnunet-helper-dns.c')
-rw-r--r--src/dns/gnunet-helper-dns.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dns/gnunet-helper-dns.c b/src/dns/gnunet-helper-dns.c
index 07cc9647c..56b8713cf 100644
--- a/src/dns/gnunet-helper-dns.c
+++ b/src/dns/gnunet-helper-dns.c
@@ -760,7 +760,9 @@ main (int argc, char *const*argv)
760 return 6; 760 return 6;
761 } 761 }
762 } 762 }
763 if (SIG_ERR == signal (SIGTERM, &signal_handler)) 763 if ( (SIG_ERR == signal (SIGTERM, &signal_handler)) ||
764 (SIG_ERR == signal (SIGINT, &signal_handler)) ||
765 (SIG_ERR == signal (SIGHUP, &signal_handler)) )
764 { 766 {
765 fprintf (stderr, 767 fprintf (stderr,
766 "Fatal: could not initialize signal handler: %s\n", 768 "Fatal: could not initialize signal handler: %s\n",
@@ -779,7 +781,9 @@ main (int argc, char *const*argv)
779 if (-1 == (fd_tun = init_tun (dev))) 781 if (-1 == (fd_tun = init_tun (dev)))
780 { 782 {
781 fprintf (stderr, "Fatal: could not initialize tun-interface\n"); 783 fprintf (stderr, "Fatal: could not initialize tun-interface\n");
784 (void) signal (SIGTERM, SIG_IGN);
782 (void) signal (SIGINT, SIG_IGN); 785 (void) signal (SIGINT, SIG_IGN);
786 (void) signal (SIGHUP, SIG_IGN);
783 (void) close (cpipe[0]); 787 (void) close (cpipe[0]);
784 (void) close (cpipe[1]); 788 (void) close (cpipe[1]);
785 return 5; 789 return 5;
@@ -793,7 +797,9 @@ main (int argc, char *const*argv)
793 if ((prefix_len < 1) || (prefix_len > 127)) 797 if ((prefix_len < 1) || (prefix_len > 127))
794 { 798 {
795 fprintf (stderr, "Fatal: prefix_len out of range\n"); 799 fprintf (stderr, "Fatal: prefix_len out of range\n");
800 (void) signal (SIGTERM, SIG_IGN);
796 (void) signal (SIGINT, SIG_IGN); 801 (void) signal (SIGINT, SIG_IGN);
802 (void) signal (SIGHUP, SIG_IGN);
797 (void) close (cpipe[0]); 803 (void) close (cpipe[0]);
798 (void) close (cpipe[1]); 804 (void) close (cpipe[1]);
799 return 2; 805 return 2;
@@ -941,8 +947,10 @@ main (int argc, char *const*argv)
941 cleanup_rest: 947 cleanup_rest:
942 /* close virtual interface */ 948 /* close virtual interface */
943 (void) close (fd_tun); 949 (void) close (fd_tun);
944 /* remove SIGINT handler so we can close the pipes */ 950 /* remove signal handler so we can close the pipes */
951 (void) signal (SIGTERM, SIG_IGN);
945 (void) signal (SIGINT, SIG_IGN); 952 (void) signal (SIGINT, SIG_IGN);
953 (void) signal (SIGHUP, SIG_IGN);
946 (void) close (cpipe[0]); 954 (void) close (cpipe[0]);
947 (void) close (cpipe[1]); 955 (void) close (cpipe[1]);
948 return r; 956 return r;