summaryrefslogtreecommitdiff
path: root/wiretap/file_wrappers.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-07 21:53:31 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-07 21:53:31 +0000
commitd00527f3690b6ca2b685d77538b1ff6c7d645da9 (patch)
tree4427ffcb9300a5c13bf7b616b680718387cf6763 /wiretap/file_wrappers.h
parent538b62429d7097d0415f91a10246e2ecca9ff149 (diff)
downloadwireshark-d00527f3690b6ca2b685d77538b1ff6c7d645da9.tar.gz
From Jakub Zawadzki:
Introduce file_clearerr I'm unsure of this patch, gzclearerr() is used to clear the end-of-file mark, but for FILE there's function which do the same (clearerr). I created test program if clearerr() is needed for tailing file. and it seems to work without it (at least on Linux, so for !HAVE_LIBZ I commented it out). For now this patch introduce file_clearerr macro, and define it only when EOF marking must be cleared (i.e. when HAVE_LIBZ and HAVE_GZCLEARERR are defined). So everything works like before, patch just to keep same prefix for file interface :) svn path=/trunk/; revision=36510
Diffstat (limited to 'wiretap/file_wrappers.h')
-rw-r--r--wiretap/file_wrappers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h
index 544d995b6b..96e0c3482e 100644
--- a/wiretap/file_wrappers.h
+++ b/wiretap/file_wrappers.h
@@ -38,6 +38,10 @@ extern FILE_T file_open(const char *path);
#define file_gets(buf, len, file) gzgets((file), (buf), (len))
#define file_eof gzeof
+#ifdef HAVE_GZCLEARERR
+#define file_clearerr gzclearerr
+#endif
+
#else /* No zLib */
#define file_open(path) ws_fopen(path, "rb")
@@ -47,6 +51,7 @@ extern FILE_T file_open(const char *path);
#define file_getc fgetc
#define file_gets fgets
#define file_eof feof
+/* #define file_clearerr clearerr */
#endif /* HAVE_LIBZ */