From eed38c1bb1a12015377d30e9ceff9525e050850e Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 3 Sep 2013 11:48:00 +0200 Subject: ose: Convert EFILE_SEEK to unistd seek for gzio This is needed because OSE does not have the same integers as unix/win32 for SEEK_ST and friends. --- erts/emulator/drivers/common/gzio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 #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; -- cgit v1.2.3