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:
parent
483e459a7e
commit
9803122c8e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue