summaryrefslogtreecommitdiff
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-05-09 03:48:41 +0000
committerGuy Harris <guy@alum.mit.edu>2011-05-09 03:48:41 +0000
commit42ba70cf9c7b906c73721065e5b7425bf2ff663e (patch)
treec32eb0c5b631d592b7ba54656b44967a6489740a /wiretap/file_access.c
parent37adc5c880a3b7f66893a6979b4aca5cce31019e (diff)
downloadwireshark-42ba70cf9c7b906c73721065e5b7425bf2ff663e.tar.gz
If a gzipped file's name ends in .caz, don't check the CRC - it's
probably a compressed file from the Windows Sniffer, and they don't bother setting the CRC. svn path=/trunk/; revision=37024
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index 7df57d933e..ed213e6df8 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -293,7 +293,7 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
if (use_stdin) {
/*
* We dup FD 0, so that we don't have to worry about
- * an fclose or gzclose of wth->fh closing the standard
+ * a file_close of wth->fh closing the standard
* input of the process.
*/
wth->fd = ws_dup(0);
@@ -310,20 +310,19 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
return NULL;
}
#endif
+ if (!(wth->fh = filed_open(wth->fd))) {
+ *err = errno;
+ ws_close(wth->fd);
+ g_free(wth);
+ return NULL;
+ }
} else {
- wth->fd = ws_open(filename, O_RDONLY|O_BINARY, 0000 /* no creation so don't matter */);
- if (wth->fd < 0) {
+ if (!(wth->fh = file_open(filename))) {
*err = errno;
g_free(wth);
return NULL;
}
}
- if (!(wth->fh = filed_open(wth->fd))) {
- *err = errno;
- ws_close(wth->fd);
- g_free(wth);
- return NULL;
- }
if (do_random) {
if (!(wth->random_fh = file_open(filename))) {