diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2011-05-21 20:57:00 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2011-05-21 20:57:00 +0000 |
commit | bfb7d262e8cbe997b9e072aeb4906b7a34af9e51 (patch) | |
tree | 7589c7c1a7eb9d27ac2d248cebd21650604b29c9 | |
parent | 17dd51831fbcace47b04d53919c2eda98a07d7f7 (diff) |
Use appropriate temporary filename when capturing from multiple interfaces.
svn path=/trunk/; revision=37344
-rw-r--r-- | dumpcap.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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); |