diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-02-10 02:05:30 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-02-10 02:05:30 +0000 |
commit | 743d4a8a677835a8848c21e464d1006a09a93ec3 (patch) | |
tree | e906ceda128cc5fd13c23de04c9414e5864af895 /dumpcap.c | |
parent | f35cc108eadef579db32178bf72f3ccd6e6d4b0b (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17240 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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); |