Prevent the secchan from dying due to SIGPIPE.
authorBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2008 23:21:45 +0000 (16:21 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2008 23:21:45 +0000 (16:21 -0700)
Fix for bug #88.

controller/controller.c
secchan/secchan.c
switch/switch.c
utilities/dpctl.c

index bc18748..01037bb 100644 (file)
@@ -36,6 +36,7 @@
 #include <errno.h>
 #include <getopt.h>
 #include <limits.h>
+#include <signal.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -93,6 +94,7 @@ main(int argc, char *argv[])
     time_init();
     vlog_init();
     parse_options(argc, argv);
+    signal(SIGPIPE, SIG_IGN);
 
     if (argc - optind < 1) {
         fatal(0, "at least one vconn argument required; use --help for usage");
index 64a1f23..af52ed5 100644 (file)
@@ -40,6 +40,7 @@
 #include <poll.h>
 #include <regex.h>
 #include <stdlib.h>
+#include <signal.h>
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
@@ -179,6 +180,7 @@ main(int argc, char *argv[])
     time_init();
     vlog_init();
     parse_options(argc, argv, &s);
+    signal(SIGPIPE, SIG_IGN);
 
     /* Start listening for management connections. */
     if (s.listen_vconn_name) {
index 3a02f64..3a9c604 100644 (file)
@@ -35,6 +35,7 @@
 #include <errno.h>
 #include <getopt.h>
 #include <limits.h>
+#include <signal.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
@@ -81,6 +82,7 @@ main(int argc, char *argv[])
     time_init();
     vlog_init();
     parse_options(argc, argv);
+    signal(SIGPIPE, SIG_IGN);
 
     if (argc - optind != 1) {
         fatal(0, "missing controller argument; use --help for usage");
index 8a075f9..b074edd 100644 (file)
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
     time_init();
     vlog_init();
     parse_options(argc, argv);
+    signal(SIGPIPE, SIG_IGN);
 
     argc -= optind;
     argv += optind;