aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-11-21 17:14:54 +0000
committerGuy Harris <guy@alum.mit.edu>2012-11-21 17:14:54 +0000
commitd415d3d87cd112d26b6508d377be30f3b1d9771c (patch)
tree44355aa9144fb53b62a4748d10dc34bb39adb67a /tshark.c
parent03f4fa5223c5bfe90d79bcf94f34ffd2d87d78d2 (diff)
On error, have capture_opts_trim_iface() return the exit status that
should be used (on success, have it return 0). Exit with that exit status; if the problem is that we couldn't get the interface list or if there are no interfaces in that list, return 2, as that's not a command-line syntax error. svn path=/trunk/; revision=46108
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tshark.c b/tshark.c
index dfc4c62ad1..8709c6fcc4 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1871,10 +1871,10 @@ main(int argc, char *argv[])
do we have support for live captures? */
#ifdef HAVE_LIBPCAP
/* trim the interface name and exit if that failed */
- if (!capture_opts_trim_iface(&global_capture_opts,
- ((prefs_p->capture_device) && (*prefs_p->capture_device != '\0')) ? get_if_name(prefs_p->capture_device) : NULL)) {
- return 2;
- }
+ exit_status = capture_opts_trim_iface(&global_capture_opts,
+ ((prefs_p->capture_device) && (*prefs_p->capture_device != '\0')) ? get_if_name(prefs_p->capture_device) : NULL);
+ if (exit_status != 0)
+ return exit_status;
/* if requested, list the link layer types and exit */
if (list_link_layer_types) {