diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-09-15 21:50:50 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-09-15 21:50:50 +0000 |
commit | b95f7e92ae937ae48051083198da85a4338b7b34 (patch) | |
tree | 324358a79442133a85a33f176057aa7249352d6a /wiretap | |
parent | 740a53095ca0d6aa0664d85cd5f4119b0ca58beb (diff) |
Fix for bug 2875:
Fix a final eth_fopen -> ws_fopen
When configuring with --without-zlib these functions need to have some parameters tagged _U_
svn path=/trunk/; revision=26212
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/file_access.c | 31 | ||||
-rw-r--r-- | wiretap/file_wrappers.h | 2 |
2 files changed, 22 insertions, 11 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 8b6b212fce..ce75770ba7 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -688,18 +688,21 @@ gboolean wtap_dump_can_write_encap(int filetype, int encap) return TRUE; } +#ifdef HAVE_LIBZ gboolean wtap_dump_can_compress(int filetype) { -#ifdef HAVE_LIBZ if (filetype < 0 || filetype >= wtap_num_file_types || dump_open_table[filetype].can_compress == FALSE) return FALSE; return TRUE; +} #else +gboolean wtap_dump_can_compress(int filetype _U_) +{ return FALSE; -#endif } +#endif static gboolean wtap_dump_open_check(int filetype, int encap, gboolean comressed, int *err); @@ -945,30 +948,38 @@ void wtap_set_bytes_dumped(wtap_dumper *wdh, gint64 bytes_dumped) /* internally open a file for writing (compressed or not) */ +#ifdef HAVE_LIBZ static FILE *wtap_dump_file_open(wtap_dumper *wdh, const char *filename) { -#ifdef HAVE_LIBZ if(wdh->compressed) { return gzopen(filename, "wb"); - } else -#endif - { + } else { return ws_fopen(filename, "wb"); } } +#else +static FILE *wtap_dump_file_open(wtap_dumper *wdh _U_, const char *filename) +{ + return ws_fopen(filename, "wb"); +} +#endif /* internally open a file for writing (compressed or not) */ +#ifdef HAVE_LIBZ static FILE *wtap_dump_file_fdopen(wtap_dumper *wdh, int fd) { -#ifdef HAVE_LIBZ if(wdh->compressed) { return gzdopen(fd, "wb"); - } else -#endif - { + } else { return fdopen(fd, "wb"); } } +#else +static FILE *wtap_dump_file_fdopen(wtap_dumper *wdh _U_, int fd) +{ + return fdopen(fd, "wb"); +} +#endif /* internally writing raw bytes (compressed or not) */ size_t wtap_dump_file_write(wtap_dumper *wdh, const void *buf, unsigned bufsize) diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h index b990a0014a..9e24b0be6d 100644 --- a/wiretap/file_wrappers.h +++ b/wiretap/file_wrappers.h @@ -42,7 +42,7 @@ extern FILE_T file_open(const char *path, const char *mode); #else /* No zLib */ -#define file_open(path, mode) eth_fopen(path, mode) +#define file_open(path, mode) ws_fopen(path, mode) #define filed_open fdopen /* XX: file_read and file_write defined to return number of *bytes* to be consistent with gzread & gzwrite */ #define file_read(buf, bsize, count, file) ((bsize) * fread((buf), (bsize), (count), (file))) |