aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-02-28 22:45:18 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-02-28 22:45:18 +0000
commit793e70956e1d26a816dffd5e9faa265ef89a1bc0 (patch)
tree7e15ab81c60e55866755cae0dad91b2941ca655f /tshark.c
parent6265ac771cc82b44b212bc3f9a4490285ba75044 (diff)
Fix problem where specifying -b duration:xx on tshark wasn't working by
testing for the "duration specified" variable along with the "maximum file size" variable. svn path=/trunk/; revision=20950
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tshark.c b/tshark.c
index aba9157239..74a02dd14e 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1267,13 +1267,10 @@ main(int argc, char *argv[])
exit(1);
}
if (capture_opts.multi_files_on) {
- /* Multiple-file mode works only under certain conditions:
+ /* Multiple-file mode doesn't work under certain conditions:
a) it doesn't work if you're writing to the standard output;
b) it doesn't work if you're writing to a pipe;
- c) it makes no sense if the maximum file size is set to "infinite"
- (XXX - shouldn't that be "if there is no stop criterion",
- as you might want to switch files based on a packet count
- or a time). */
+ */
if (strcmp(capture_opts.save_file, "-") == 0) {
cmdarg_err("Multiple capture files requested, but "
"the capture is being written to the standard output.");
@@ -1284,9 +1281,10 @@ main(int argc, char *argv[])
"the capture file is a pipe.");
exit(1);
}
- if (!capture_opts.has_autostop_filesize) {
+ if (!capture_opts.has_autostop_filesize &&
+ !capture_opts.has_file_duration) {
cmdarg_err("Multiple capture files requested, but "
- "no maximum capture file size was specified.");
+ "no maximum capture file size or duration was specified.");
exit(1);
}
}