diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-11-21 17:14:54 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-11-21 17:14:54 +0000 |
commit | d415d3d87cd112d26b6508d377be30f3b1d9771c (patch) | |
tree | 44355aa9144fb53b62a4748d10dc34bb39adb67a /tshark.c | |
parent | 03f4fa5223c5bfe90d79bcf94f34ffd2d87d78d2 (diff) | |
download | wireshark-d415d3d87cd112d26b6508d377be30f3b1d9771c.tar.gz wireshark-d415d3d87cd112d26b6508d377be30f3b1d9771c.tar.bz2 wireshark-d415d3d87cd112d26b6508d377be30f3b1d9771c.zip |
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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) { |