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>
This commit is contained in:
Gerald Combs 2014-05-12 09:57:44 -07:00
parent 483e459a7e
commit 9803122c8e
1 changed files with 7 additions and 0 deletions

View File

@ -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