aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2011-05-21 20:57:00 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2011-05-21 20:57:00 +0000
commitbfb7d262e8cbe997b9e072aeb4906b7a34af9e51 (patch)
tree7589c7c1a7eb9d27ac2d248cebd21650604b29c9
parent17dd51831fbcace47b04d53919c2eda98a07d7f7 (diff)
Use appropriate temporary filename when capturing from multiple interfaces.
svn path=/trunk/; revision=37344
-rw-r--r--dumpcap.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 56529dc79d..17946b6d12 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2859,15 +2859,19 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
is_tempfile = FALSE;
} else {
/* Choose a random name for the temporary capture buffer */
+ if (global_capture_opts.ifaces->len > 1) {
+ prefix = g_strdup_printf("wireshark_%d_interfaces", global_capture_opts.ifaces->len);
+ } else {
#ifdef _WIN32
- GString *iface;
+ GString *iface;
- iface = isolate_uuid(g_array_index(global_capture_opts.ifaces, interface_options, global_capture_opts.ifaces->len - 1).name);
- prefix = g_strconcat("wireshark_", g_basename(iface->str), NULL);
- g_string_free(iface, TRUE);
+ iface = isolate_uuid(g_array_index(global_capture_opts.ifaces, interface_options, 0).name);
+ prefix = g_strconcat("wireshark_", g_basename(iface->str), NULL);
+ g_string_free(iface, TRUE);
#else
- prefix = g_strconcat("wireshark_", g_basename(g_array_index(global_capture_opts.ifaces, interface_options, global_capture_opts.ifaces->len - 1).name), NULL);
+ prefix = g_strconcat("wireshark_", g_basename(g_array_index(global_capture_opts.ifaces, interface_options, 0).name), NULL);
#endif
+ }
*save_file_fd = create_tempfile(&tmpname, prefix);
g_free(prefix);
capfile_name = g_strdup(tmpname);