diff --git a/capinfos.c b/capinfos.c index afab0dbac4..72fb14a6a5 100644 --- a/capinfos.c +++ b/capinfos.c @@ -88,14 +88,14 @@ /* * By default capinfos now continues processing * the next filename if and when wiretap detects - * a problem opening a file. + * a problem opening or reading a file. * Use the '-C' option to revert back to original * capinfos behavior which is to abort any - * additional file processing at first open file - * failure. + * additional file processing at the first file + * open or read failure. */ -static gboolean stop_after_wtap_open_offline_failure = FALSE; +static gboolean stop_after_failure = FALSE; /* * table report variables @@ -1561,7 +1561,7 @@ main(int argc, char *argv[]) break; case 'C': - stop_after_wtap_open_offline_failure = TRUE; + stop_after_failure = TRUE; break; case 'A': @@ -1679,7 +1679,7 @@ main(int argc, char *argv[]) if (!wth) { cfile_open_failure_message("capinfos", argv[opt], err, err_info); overall_error_status = 2; /* remember that an error has occurred */ - if (stop_after_wtap_open_offline_failure) + if (stop_after_failure) goto exit; } @@ -1691,7 +1691,8 @@ main(int argc, char *argv[]) wtap_close(wth); if (status) { overall_error_status = status; - goto exit; + if (stop_after_failure) + goto exit; } } } diff --git a/doc/capinfos.pod b/doc/capinfos.pod index 32c8274c4d..62539df56a 100644 --- a/doc/capinfos.pod +++ b/doc/capinfos.pod @@ -124,13 +124,15 @@ Displays the number of packets in the capture file. =item -C Cancel processing any additional files if and -when capinfos should fail to open an input file. -By default capinfos will attempt to open each and -every file name argument. +when capinfos fails to open an input file +or gets an error reading an input file. +By default capinfos will continue processing files +even if it gets an error opening or reading a file. Note: An error message will be written to stderr -whenever capinfos fails to open a file regardless -of whether the -C option is specified or not. +whenever capinfos fails to open a file or gets +an error reading from a file regardless whether +the -C option is specified or not. Upon exit, capinfos will return an error status if any errors occurred during processing.