aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-08-09 14:41:11 -0700
committerGuy Harris <gharris@sonic.net>2020-08-09 23:08:51 +0000
commit74e917fc6ce8f2577dd15637b29ced31a0d1ebbf (patch)
treef299822096193b72170b763b7eb8e541cdc5245a /extcap
parentfcd7492566f8cdb1bdce6c6bdc9f65a889e2de97 (diff)
wiretap: have wtap_dump_flush(), and its callers, check for errors.
Change-Id: Ibcddf1a949f775afa49d36a2d165c3685556035d Reviewed-on: https://code.wireshark.org/review/38104 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'extcap')
-rw-r--r--extcap/androiddump.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index 7009679092..a6d838fa41 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -460,7 +460,10 @@ static struct extcap_dumper extcap_dumper_open(char *fifo, int encap) {
exit(EXIT_CODE_CANNOT_SAVE_WIRETAP_DUMP);
}
extcap_dumper.encap = encap;
- wtap_dump_flush(extcap_dumper.dumper.wtap);
+ if (!wtap_dump_flush(extcap_dumper.dumper.wtap, &err)) {
+ cfile_dump_open_failure_message("androiddump", fifo, err, WTAP_FILE_TYPE_SUBTYPE_PCAP_NSEC);
+ exit(EXIT_CODE_CANNOT_SAVE_WIRETAP_DUMP);
+ }
#endif
return extcap_dumper;
@@ -521,7 +524,11 @@ static gboolean extcap_dumper_dump(struct extcap_dumper extcap_dumper,
return FALSE;
}
- wtap_dump_flush(extcap_dumper.dumper.wtap);
+ if (!wtap_dump_flush(extcap_dumper.dumper.wtap, &err)) {
+ cfile_write_failure_message("androiddump", NULL, fifo, err, NULL,
+ 0, WTAP_FILE_TYPE_SUBTYPE_PCAP_NSEC);
+ return FALSE;
+ }
#endif
return TRUE;