aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorBalint Reczey <balint.reczey@ericsson.com>2008-10-30 11:48:13 +0000
committerBalint Reczey <balint.reczey@ericsson.com>2008-10-30 11:48:13 +0000
commitc2ce5dcbf6968253b954ed31253196f16216645c (patch)
treeb398bc62412ae9e42ceb374aee9e9ddd786f1cf3 /dumpcap.c
parentf763c88092fcf80df72b3a0825dd5c8a1aed3cc2 (diff)
Based on patch from Sergio Barjola:
Enable the default action for SIGPIPE This fixes bug 2888 and 1740 svn path=/trunk/; revision=26621
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index a8aa166ce7..a359667e93 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -411,6 +411,9 @@ print_statistics_loop(gboolean machine_readable)
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) {
@@ -453,6 +456,13 @@ print_statistics_loop(gboolean machine_readable)
"Dropped");
}
+#ifndef _WIN32
+ /* handle SIGPIPE signal to default action */
+ act.sa_handler = SIG_DFL;
+ sigemptyset(&act.sa_mask);
+ sigaction(SIGPIPE,&act,NULL);
+#endif
+
global_ld.go = TRUE;
while (global_ld.go) {
for (stat_entry = g_list_first(stat_list); stat_entry != NULL; stat_entry = g_list_next(stat_entry)) {