aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common/gzio.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/drivers/common/gzio.c')
-rw-r--r--erts/emulator/drivers/common/gzio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/drivers/common/gzio.c b/erts/emulator/drivers/common/gzio.c
index 653f3954b1..9a9e297fca 100644
--- a/erts/emulator/drivers/common/gzio.c
+++ b/erts/emulator/drivers/common/gzio.c
@@ -20,6 +20,7 @@
#endif
#include <ctype.h>
#include "erl_driver.h"
+#include "erl_efile.h"
#include "sys.h"
#ifdef __WIN32__
@@ -597,6 +598,15 @@ erts_gzseek(ErtsGzFile file, int offset, int whence)
int pos;
gz_stream* s = (gz_stream *) file;
+ switch (whence) {
+ case EFILE_SEEK_SET: whence = SEEK_SET; break;
+ case EFILE_SEEK_CUR: whence = SEEK_CUR; break;
+ case EFILE_SEEK_END: whence = SEEK_END; break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
if (s == NULL) {
errno = EINVAL;
return -1;