aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.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 /dumpcap.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 'dumpcap.c')
-rw-r--r--dumpcap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 7f7fc40788..4602da345e 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -4673,9 +4673,10 @@ main(int argc, char *argv[])
* "-L", "-d", and capturing act on a particular interface, so we have to
* have an interface; if none was specified, pick a default.
*/
- if (capture_opts_trim_iface(&global_capture_opts, NULL) == FALSE) {
+ status = capture_opts_trim_iface(&global_capture_opts, NULL);
+ if (status != 0) {
/* cmdarg_err() already called .... */
- exit_main(1);
+ exit_main(status);
}
/* Let the user know what interfaces were chosen. */