aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-06-01 03:37:51 +0000
committerGuy Harris <guy@alum.mit.edu>2010-06-01 03:37:51 +0000
commit7ecae442c572adbd5ca480dae37a17e8785a7d7e (patch)
tree6802770b81fcadb2a3f603bc2a0eb5f43ee9a770
parent61e40b5c52f40d275a9b49817187a31b0176a408 (diff)
capture() can, in some cases, return FALSE when the capture succeeds;
back out the change to check its return value until we fix that. Also back out the test suite changes to look for an error exit for invalid capture filters and interfaces. svn path=/trunk/; revision=33029
-rwxr-xr-xtest/suite-clopts.sh4
-rw-r--r--tshark.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh
index b0e496c56b..1a74ade55a 100755
--- a/test/suite-clopts.sh
+++ b/test/suite-clopts.sh
@@ -113,7 +113,7 @@ clopts_step_invalid_capfilter() {
$TSHARK -f 'jkghg' -w './testout.pcap' > ./testout.txt 2>&1
RETURNVALUE=$?
- if [ ! $RETURNVALUE -eq $EXIT_ERROR ]; then
+ if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
test_step_failed "exit status: $RETURNVALUE"
else
grep -i 'Invalid capture filter: "jkghg"' ./testout.txt > /dev/null
@@ -131,7 +131,7 @@ clopts_step_invalid_capfilter() {
clopts_step_invalid_interface() {
$TSHARK -i invalid_interface -w './testout.pcap' > ./testout.txt 2>&1
RETURNVALUE=$?
- if [ ! $RETURNVALUE -eq $EXIT_ERROR ]; then
+ if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
test_step_failed "exit status: $RETURNVALUE"
else
grep -i 'The capture session could not be initiated' ./testout.txt > /dev/null
diff --git a/tshark.c b/tshark.c
index f25305a669..052af0cb68 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1682,9 +1682,16 @@ main(int argc, char *argv[])
/* For now, assume libpcap gives microsecond precision. */
timestamp_set_precision(TS_PREC_AUTO_USEC);
- if (!capture()) {
- return 2; /* an error occurred */
- }
+ /*
+ * XXX - this returns FALSE if an error occurred, but it also
+ * returns FALSE if the capture stops because a time limit
+ * was reached (and possibly other limits), so we can't assume
+ * it means an error.
+ *
+ * The capture code is a bit twisty, so it doesn't appear to
+ * be an easy fix. We just ignore the return value for now.
+ */
+ capture();
if (print_packet_info) {
if (!write_finale()) {