aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorBalint Reczey <balint.reczey@ericsson.com>2009-05-31 18:38:28 +0000
committerBalint Reczey <balint.reczey@ericsson.com>2009-05-31 18:38:28 +0000
commit1f8c72ff2587bd234d47ce0214e15c027cbec737 (patch)
tree968985d9bca11037c28e4652c7e015fbd89584d1 /dumpcap.c
parent257180c8010cddfdc2da250fe8f59e7502047daf (diff)
Set SIGPIPE handler every time the program starts.
This hopefully fixes bug 1740. svn path=/trunk/; revision=28549
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 8663fbd481..bb05b0078d 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -419,9 +419,6 @@ 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) {
@@ -464,14 +461,6 @@ print_statistics_loop(gboolean machine_readable)
"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
-
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)) {
@@ -2629,6 +2618,7 @@ main(int argc, char *argv[])
sigemptyset(&action.sa_mask);
sigaction(SIGTERM, &action, NULL);
sigaction(SIGINT, &action, NULL);
+ sigaction(SIGPIPE, &action, NULL);
sigaction(SIGHUP, NULL, &oldaction);
if (oldaction.sa_handler == SIG_DFL)
sigaction(SIGHUP, &action, NULL);