aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-27 18:00:46 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-27 18:00:46 +0000
commit8a47ad5d4edffb29296be30030fe7db74da3e515 (patch)
treeecf82b787638623aa139392d753f78b9ff4eb9d1 /capture_opts.c
parent998b30e4218a5495aaab670003f7d2264269a32c (diff)
Set RINGBUFFER_MAX_NUM_FILES to 100000. Use it to generate file names.
Add RINGBUFFER_WARN_NUM_FILES and use it to print a warning. Print warnings when we change the number of ringbuffer files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32998 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 23297b60eb..e24ec8fed1 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -604,10 +604,15 @@ void capture_opts_trim_snaplen(capture_options *capture_opts, int snaplen_min)
void capture_opts_trim_ring_num_files(capture_options *capture_opts)
{
/* Check the value range of the ring_num_files parameter */
- if (capture_opts->ring_num_files > RINGBUFFER_MAX_NUM_FILES)
+ if (capture_opts->ring_num_files > RINGBUFFER_MAX_NUM_FILES) {
+ cmdarg_err("Too many ring buffer files (%u). Reducing to %u.\n", capture_opts->ring_num_files, RINGBUFFER_MAX_NUM_FILES);
capture_opts->ring_num_files = RINGBUFFER_MAX_NUM_FILES;
+ } else if (capture_opts->ring_num_files > RINGBUFFER_WARN_NUM_FILES) {
+ cmdarg_err("%u is a lot of ring buffer files.\n", capture_opts->ring_num_files);
+ }
#if RINGBUFFER_MIN_NUM_FILES > 0
else if (capture_opts->ring_num_files < RINGBUFFER_MIN_NUM_FILES)
+ cmdarg_err("Too few ring buffer files (%u). Increasing to %u.\n", capture_opts->ring_num_files, RINGBUFFER_MIN_NUM_FILES);
capture_opts->ring_num_files = RINGBUFFER_MIN_NUM_FILES;
#endif
}