forked from osmocom/wireshark
Make load_cap_file() just return a success/fail indication.
We don't care *why* it fails; it's printed a message to indicate that. Just have it indicate whether it succeeded or not. Change-Id: I98160999baa5f25ea03ef803b7dbf77dff1518de Reviewed-on: https://code.wireshark.org/review/4213 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
22a0d65a9a
commit
29d9114b3f
12
rawshark.c
12
rawshark.c
|
@ -156,7 +156,7 @@ static print_format_e print_format = PR_FMT_TEXT;
|
||||||
static gboolean want_pcap_pkthdr;
|
static gboolean want_pcap_pkthdr;
|
||||||
|
|
||||||
cf_status_t raw_cf_open(capture_file *cf, const char *fname);
|
cf_status_t raw_cf_open(capture_file *cf, const char *fname);
|
||||||
static int load_cap_file(capture_file *cf);
|
static gboolean load_cap_file(capture_file *cf);
|
||||||
static gboolean process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset,
|
static gboolean process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset,
|
||||||
struct wtap_pkthdr *whdr, const guchar *pd);
|
struct wtap_pkthdr *whdr, const guchar *pd);
|
||||||
static void show_print_file_io_error(int err);
|
static void show_print_file_io_error(int err);
|
||||||
|
@ -455,7 +455,6 @@ main(int argc, char *argv[])
|
||||||
int pf_open_errno, pf_read_errno;
|
int pf_open_errno, pf_read_errno;
|
||||||
int gdp_open_errno, gdp_read_errno;
|
int gdp_open_errno, gdp_read_errno;
|
||||||
int dp_open_errno, dp_read_errno;
|
int dp_open_errno, dp_read_errno;
|
||||||
int err;
|
|
||||||
gchar *pipe_name = NULL;
|
gchar *pipe_name = NULL;
|
||||||
gchar *rfilters[64];
|
gchar *rfilters[64];
|
||||||
e_prefs *prefs_p;
|
e_prefs *prefs_p;
|
||||||
|
@ -904,9 +903,7 @@ main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Process the packets in the file */
|
/* Process the packets in the file */
|
||||||
err = load_cap_file(&cfile);
|
if (!load_cap_file(&cfile)) {
|
||||||
|
|
||||||
if (err != 0) {
|
|
||||||
epan_free(cfile.epan);
|
epan_free(cfile.epan);
|
||||||
epan_cleanup();
|
epan_cleanup();
|
||||||
exit(2);
|
exit(2);
|
||||||
|
@ -1013,7 +1010,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, const gchar **err
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static gboolean
|
||||||
load_cap_file(capture_file *cf)
|
load_cap_file(capture_file *cf)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
@ -1068,9 +1065,10 @@ load_cap_file(capture_file *cf)
|
||||||
cf->filename, wtap_strerror(err));
|
cf->filename, wtap_strerror(err));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in New Issue