aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-05-12 09:57:44 -0700
committerGerald Combs <gerald@wireshark.org>2014-05-12 17:05:06 +0000
commit9803122c8e1d24e1ed7f1acfb398b6f34183d9fa (patch)
tree965147d288ea7070474e181ab4503c4b1ff36f84 /ui/qt
parent483e459a7e6a4474cef2e5dd31bc4d96304446b0 (diff)
Ignore SIGPIPE on systems that have it.
According to the GTK+ docs, gtk_init calls "signal(SIGPIPE, SIG_IGN)" at startup. Replicate that behavior here, otherwise we tend to terminate unexpectedly. Change-Id: Ia017402755d647e6050af40deacef6765eea8694 Reviewed-on: https://code.wireshark.org/review/1614 Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index d4aced1b34..15ba44c7b8 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -29,6 +29,8 @@
#include <glib.h>
+#include <signal.h>
+
#ifndef HAVE_GETOPT
# include "wsutil/wsgetopt.h"
#else
@@ -784,6 +786,11 @@ int main(int argc, char *argv[])
wsApp->setLastOpenDir(get_persdatafile_dir());
}
+#ifdef Q_OS_UNIX
+ // Replicates behavior in gtk_init();
+ signal(SIGPIPE, SIG_IGN);
+#endif
+
#ifdef HAVE_LIBPCAP
capture_callback_add(main_capture_callback, NULL);
#endif