aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capture_loop.c6
-rw-r--r--ringbuffer.c10
-rw-r--r--ringbuffer.h4
-rw-r--r--tethereal.c6
4 files changed, 13 insertions, 13 deletions
diff --git a/capture_loop.c b/capture_loop.c
index fdad9599b4..76a9685266 100644
--- a/capture_loop.c
+++ b/capture_loop.c
@@ -840,7 +840,7 @@ static int capture_loop_open_wiretap_output(capture_options *capture_opts, loop_
static gboolean capture_loop_close_output(capture_options *capture_opts, loop_data *ld, int *err_close) {
if (capture_opts->multi_files_on) {
- return ringbuf_wtap_dump_close(&cfile, err_close);
+ return ringbuf_wtap_dump_close(&cfile.save_file, err_close);
} else {
return wtap_dump_close(ld->wtap_pdh, err_close);
}
@@ -1106,7 +1106,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
}
/* Switch to the next ringbuffer file */
- if (ringbuf_switch_file(&cfile, &ld.wtap_pdh, &ld.err)) {
+ if (ringbuf_switch_file(&ld.wtap_pdh, &cfile.save_file, &cfile.save_file_fd, &ld.err)) {
/* File switch succeeded: reset the conditions */
cnd_reset(cnd_autostop_size);
if (cnd_file_duration) {
@@ -1175,7 +1175,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
}
/* Switch to the next ringbuffer file */
- if (ringbuf_switch_file(&cfile, &ld.wtap_pdh, &ld.err)) {
+ if (ringbuf_switch_file(&ld.wtap_pdh, &cfile.save_file, &cfile.save_file_fd, &ld.err)) {
/* file switch succeeded: reset the conditions */
cnd_reset(cnd_file_duration);
if(cnd_autostop_size)
diff --git a/ringbuffer.c b/ringbuffer.c
index cc633eab3c..1a89e6d4bb 100644
--- a/ringbuffer.c
+++ b/ringbuffer.c
@@ -252,7 +252,7 @@ ringbuf_init_wtap_dump_fdopen(int filetype, int linktype, int snaplen, int *err)
* Switches to the next ringbuffer file
*/
gboolean
-ringbuf_switch_file(capture_file *cf, wtap_dumper **pdh, int *err)
+ringbuf_switch_file(wtap_dumper **pdh, gchar **save_file, int *save_file_fd, int *err)
{
int next_file_num;
rb_file *next_rfile = NULL;
@@ -285,8 +285,8 @@ ringbuf_switch_file(capture_file *cf, wtap_dumper **pdh, int *err)
/* switch to the new file */
rb_data.curr_file_num = next_file_num;
- cf->save_file = next_rfile->name;
- cf->save_file_fd = rb_data.fd;
+ *save_file = next_rfile->name;
+ *save_file_fd = rb_data.fd;
(*pdh) = rb_data.pdh;
return TRUE;
@@ -296,7 +296,7 @@ ringbuf_switch_file(capture_file *cf, wtap_dumper **pdh, int *err)
* Calls wtap_dump_close() for the current ringbuffer file
*/
gboolean
-ringbuf_wtap_dump_close(capture_file *cf, int *err)
+ringbuf_wtap_dump_close(gchar **save_file, int *err)
{
gboolean ret_val = TRUE;
@@ -312,7 +312,7 @@ ringbuf_wtap_dump_close(capture_file *cf, int *err)
}
/* set the save file name to the current file */
- cf->save_file = rb_data.files[rb_data.curr_file_num].name;
+ *save_file = rb_data.files[rb_data.curr_file_num].name;
return ret_val;
}
diff --git a/ringbuffer.h b/ringbuffer.h
index f3acec11e0..b5904053e3 100644
--- a/ringbuffer.h
+++ b/ringbuffer.h
@@ -40,8 +40,8 @@
int ringbuf_init(const char *capture_name, guint num_files);
wtap_dumper* ringbuf_init_wtap_dump_fdopen(int filetype, int linktype,
int snaplen, int *err);
-gboolean ringbuf_switch_file(capture_file *cf, wtap_dumper **pdh, int *err);
-gboolean ringbuf_wtap_dump_close(capture_file *cf, int *err);
+gboolean ringbuf_switch_file(wtap_dumper **pdh, gchar **save_file, int *save_file_fd, int *err);
+gboolean ringbuf_wtap_dump_close(gchar **save_file, int *err);
void ringbuf_free(void);
void ringbuf_error_cleanup(void);
diff --git a/tethereal.c b/tethereal.c
index c015bcdd49..367ec2c73c 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -2034,7 +2034,7 @@ capture(int out_file_type)
its maximum size. */
if (capture_opts.ringbuffer_on) {
/* Switch to the next ringbuffer file */
- if (ringbuf_switch_file(&cfile, &ld.pdh, &loop_err)) {
+ if (ringbuf_switch_file(&ld.pdh, &cfile.save_file, &cfile.save_file_fd, &loop_err)) {
/* File switch succeeded: reset the condition */
cnd_reset(cnd_stop_capturesize);
if (cnd_ring_timeout) {
@@ -2103,7 +2103,7 @@ capture(int out_file_type)
if (cfile.save_file != NULL) {
/* We're saving to a file or files; close all files. */
if (capture_opts.ringbuffer_on) {
- dump_ok = ringbuf_wtap_dump_close(&cfile, &err);
+ dump_ok = ringbuf_wtap_dump_close(&cfile.save_file, &err);
} else {
dump_ok = wtap_dump_close(ld.pdh, &err);
}
@@ -2193,7 +2193,7 @@ capture_pcap_cb(guchar *user, const struct pcap_pkthdr *phdr,
*/
if (cnd_ring_timeout != NULL && cnd_eval(cnd_ring_timeout)) {
/* time elapsed for this ring file, switch to the next */
- if (ringbuf_switch_file(&cfile, &ldat->pdh, &loop_err)) {
+ if (ringbuf_switch_file(&ldat->pdh, &cfile.save_file, &cfile.save_file_fd, &loop_err)) {
/* File switch succeeded: reset the condition */
cnd_reset(cnd_ring_timeout);
} else {