wireshark/wireshark-1.0.6-sigpipe-block.patch

36 lines
873 B
Diff
Raw Normal View History

--- capture_opts.c
+++ capture_opts.c
@@ -59,6 +59,7 @@
# include "inet_v6defs.h"
#endif
+#include <signal.h>
#include <glib.h>
#include <epan/packet.h>
@@ -717,6 +718,9 @@
pcap_t *pch;
char errbuf[PCAP_ERRBUF_SIZE];
struct pcap_stat ps;
+#ifndef _WIN32
+ struct sigaction act;
+#endif
if_list = get_interface_list(&err, &err_str);
if (if_list == NULL) {
@@ -755,6 +759,14 @@
"Dropped");
}
+#ifndef _WIN32
+ /* handle SIGPIPE signal to default action */
+ act.sa_handler = SIG_DFL;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGPIPE,&act,NULL);
+#endif
+
while (1) { /* XXX - Add signal handling? */
for (stat_entry = g_list_first(stat_list); stat_entry != NULL; stat_entry = g_list_next(stat_entry)) {
if_stat = stat_entry->data;