aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-02-10 02:05:30 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-02-10 02:05:30 +0000
commite4e8df5e1d7baea590c02edf369c65e82ffaece2 (patch)
treee906ceda128cc5fd13c23de04c9414e5864af895 /dumpcap.c
parent0d9c276e901f8a3e5de9ae2502a078ffb3d90064 (diff)
remove all calls to exit() from the capture_opts.c and replace them by status return values (0,1 or 2).
This way makes it much easier to debug, e.g. to set a common breakpoint if a command line parameter fails. svn path=/trunk/; revision=17240
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/dumpcap.c b/dumpcap.c
index a8e84d776d..659b922ba8 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -252,6 +252,7 @@ main(int argc, char *argv[])
struct pcap_stat stats;
GLogLevelFlags log_flags;
gboolean list_link_layer_types = FALSE;
+ int status;
#define OPTSTRING_INIT "a:b:c:Df:hi:Lps:vw:y:"
@@ -358,13 +359,16 @@ main(int argc, char *argv[])
/* Hidden option supporting Sync mode */
case 'Z': /* Write to pipe FD x */
#endif /* _WIN32 */
- capture_opts_add_opt(capture_opts, opt, optarg, &start_capture);
+ status = capture_opts_add_opt(capture_opts, opt, optarg, &start_capture);
+ if(status != 0) {
+ exit_main(status);
+ }
break;
/*** all non capture option specific ***/
case 'D': /* Print a list of capture devices and exit */
- capture_opts_list_interfaces();
- exit_main(0);
+ status = capture_opts_list_interfaces();
+ exit_main(status);
break;
case 'L': /* Print list of link-layer types and exit */
list_link_layer_types = TRUE;
@@ -441,8 +445,8 @@ main(int argc, char *argv[])
}
if (list_link_layer_types) {
- capture_opts_list_link_layer_types(capture_opts);
- exit_main(0);
+ status = capture_opts_list_link_layer_types(capture_opts);
+ exit_main(status);
}
capture_opts_trim_snaplen(capture_opts, MIN_PACKET_SIZE);